Skip to content

Commit

Permalink
src: stop using deprecated v8::ApiObject
Browse files Browse the repository at this point in the history
Backport-PR-URL: #39470
PR-URL: #38990
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos authored and BethGriggs committed Jul 29, 2021
1 parent 929205e commit b230ac1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ typedef int mode_t;

namespace node {

using v8::ApiObject;
using v8::Array;
using v8::ArrayBuffer;
using v8::BackingStore;
Expand Down Expand Up @@ -478,8 +477,8 @@ class FastHrtime : public BaseObject {
SET_MEMORY_INFO_NAME(FastHrtime)
SET_SELF_SIZE(FastHrtime)

static FastHrtime* FromV8ApiObject(ApiObject api_object) {
Object* v8_object = reinterpret_cast<Object*>(&api_object);
static FastHrtime* FromV8Value(Local<Value> value) {
Local<Object> v8_object = value.As<Object>();
return static_cast<FastHrtime*>(
v8_object->GetAlignedPointerFromInternalField(BaseObject::kSlot));
}
Expand All @@ -501,8 +500,8 @@ class FastHrtime : public BaseObject {
fields[2] = t % NANOS_PER_SEC;
}

static void FastNumber(ApiObject receiver) {
NumberImpl(FromV8ApiObject(receiver));
static void FastNumber(Local<Value> receiver) {
NumberImpl(FromV8Value(receiver));
}

static void SlowNumber(const FunctionCallbackInfo<Value>& args) {
Expand All @@ -515,8 +514,8 @@ class FastHrtime : public BaseObject {
fields[0] = t;
}

static void FastBigInt(ApiObject receiver) {
BigIntImpl(FromV8ApiObject(receiver));
static void FastBigInt(Local<Value> receiver) {
BigIntImpl(FromV8Value(receiver));
}

static void SlowBigInt(const FunctionCallbackInfo<Value>& args) {
Expand Down

0 comments on commit b230ac1

Please sign in to comment.