Skip to content

Commit b230ac1

Browse files
targosBethGriggs
authored andcommitted
src: stop using deprecated v8::ApiObject
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>
1 parent 929205e commit b230ac1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/node_process_methods.cc

+6-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ typedef int mode_t;
3434

3535
namespace node {
3636

37-
using v8::ApiObject;
3837
using v8::Array;
3938
using v8::ArrayBuffer;
4039
using v8::BackingStore;
@@ -478,8 +477,8 @@ class FastHrtime : public BaseObject {
478477
SET_MEMORY_INFO_NAME(FastHrtime)
479478
SET_SELF_SIZE(FastHrtime)
480479

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

504-
static void FastNumber(ApiObject receiver) {
505-
NumberImpl(FromV8ApiObject(receiver));
503+
static void FastNumber(Local<Value> receiver) {
504+
NumberImpl(FromV8Value(receiver));
506505
}
507506

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

518-
static void FastBigInt(ApiObject receiver) {
519-
BigIntImpl(FromV8ApiObject(receiver));
517+
static void FastBigInt(Local<Value> receiver) {
518+
BigIntImpl(FromV8Value(receiver));
520519
}
521520

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

0 commit comments

Comments
 (0)