Skip to content

Commit 34de704

Browse files
committed
src: use the internal field to determine if an object is a BaseObject
Instead of storing the function template of BaseObject for checking if an object is BaseObject by calling HasInstance, simply checks the first internal field of the object, which is always set in the BaseObject constructor. This is simpler and faster (there is now no need to iterate over the inheritance for the check).
1 parent 1a18b44 commit 34de704

28 files changed

+24
-76
lines changed

src/async_wrap.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ Local<FunctionTemplate> AsyncWrap::GetConstructorTemplate(
342342
tmpl = NewFunctionTemplate(isolate, nullptr);
343343
tmpl->SetClassName(
344344
FIXED_ONE_BYTE_STRING(isolate_data->isolate(), "AsyncWrap"));
345-
tmpl->Inherit(BaseObject::GetConstructorTemplate(isolate_data));
346345
SetProtoMethod(isolate, tmpl, "getAsyncId", AsyncWrap::GetAsyncId);
347346
SetProtoMethod(isolate, tmpl, "asyncReset", AsyncWrap::AsyncReset);
348347
SetProtoMethod(

src/base_object-inl.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> object)
3838
// while allowing to create a BaseObject in a vm context.
3939
}
4040

41-
// static
42-
v8::Local<v8::FunctionTemplate> BaseObject::GetConstructorTemplate(
43-
Environment* env) {
44-
return BaseObject::GetConstructorTemplate(env->isolate_data());
45-
}
46-
4741
void BaseObject::Detach() {
4842
CHECK_GT(pointer_data()->strong_ptr_count, 0);
4943
pointer_data()->is_detached = true;
@@ -76,6 +70,15 @@ Realm* BaseObject::realm() const {
7670
return realm_;
7771
}
7872

73+
bool BaseObject::IsBaseObject(v8::Local<v8::Object> obj) {
74+
if (obj->InternalFieldCount() < BaseObject::kInternalFieldCount) {
75+
return false;
76+
}
77+
void* ptr =
78+
obj->GetAlignedPointerFromInternalField(BaseObject::kEmbedderType);
79+
return ptr == &kNodeEmbedderId;
80+
}
81+
7982
void BaseObject::TagNodeObject(v8::Local<v8::Object> object) {
8083
DCHECK_GE(object->InternalFieldCount(), BaseObject::kInternalFieldCount);
8184
object->SetAlignedPointerInInternalField(BaseObject::kEmbedderType,

src/base_object.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ Local<FunctionTemplate> BaseObject::MakeLazilyInitializedJSTemplate(
8989
IsolateData* isolate_data) {
9090
Local<FunctionTemplate> t = NewFunctionTemplate(
9191
isolate_data->isolate(), LazilyInitializedJSTemplateConstructor);
92-
t->Inherit(BaseObject::GetConstructorTemplate(isolate_data));
9392
t->InstanceTemplate()->SetInternalFieldCount(BaseObject::kInternalFieldCount);
9493
return t;
9594
}
@@ -145,18 +144,6 @@ bool BaseObject::IsRootNode() const {
145144
return !persistent_handle_.IsWeak();
146145
}
147146

148-
Local<FunctionTemplate> BaseObject::GetConstructorTemplate(
149-
IsolateData* isolate_data) {
150-
Local<FunctionTemplate> tmpl = isolate_data->base_object_ctor_template();
151-
if (tmpl.IsEmpty()) {
152-
tmpl = NewFunctionTemplate(isolate_data->isolate(), nullptr);
153-
tmpl->SetClassName(
154-
FIXED_ONE_BYTE_STRING(isolate_data->isolate(), "BaseObject"));
155-
isolate_data->set_base_object_ctor_template(tmpl);
156-
}
157-
return tmpl;
158-
}
159-
160147
bool BaseObject::IsNotIndicativeOfMemoryLeakAtExit() const {
161148
return IsWeakOrDetached();
162149
}

src/base_object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class BaseObject : public MemoryRetainer {
7676
// e.g. when the JS object used `MakeLazilyInitializedJSTemplate`.
7777
static inline void SetInternalFields(v8::Local<v8::Object> object,
7878
void* slot);
79+
static inline bool IsBaseObject(v8::Local<v8::Object> object);
7980
static inline void TagNodeObject(v8::Local<v8::Object> object);
8081
static void LazilyInitializedJSTemplateConstructor(
8182
const v8::FunctionCallbackInfo<v8::Value>& args);

src/crypto/crypto_cipher.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,7 @@ void CipherBase::Initialize(Environment* env, Local<Object> target) {
277277

278278
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
279279

280-
t->InstanceTemplate()->SetInternalFieldCount(
281-
CipherBase::kInternalFieldCount);
282-
t->Inherit(BaseObject::GetConstructorTemplate(env));
280+
t->InstanceTemplate()->SetInternalFieldCount(CipherBase::kInternalFieldCount);
283281

284282
SetProtoMethod(isolate, t, "init", Init);
285283
SetProtoMethod(isolate, t, "initiv", InitIv);

src/crypto/crypto_context.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ Local<FunctionTemplate> SecureContext::GetConstructorTemplate(
268268
tmpl = NewFunctionTemplate(isolate, New);
269269
tmpl->InstanceTemplate()->SetInternalFieldCount(
270270
SecureContext::kInternalFieldCount);
271-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
272271
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"));
273272

274273
SetProtoMethod(isolate, tmpl, "init", Init);

src/crypto/crypto_dh.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
6969

7070
t->InstanceTemplate()->SetInternalFieldCount(
7171
DiffieHellman::kInternalFieldCount);
72-
t->Inherit(BaseObject::GetConstructorTemplate(env));
7372

7473
SetProtoMethod(isolate, t, "generateKeys", GenerateKeys);
7574
SetProtoMethod(isolate, t, "computeSecret", ComputeSecret);

src/crypto/crypto_ec.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ void ECDH::Initialize(Environment* env, Local<Object> target) {
6666
Local<Context> context = env->context();
6767

6868
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
69-
t->Inherit(BaseObject::GetConstructorTemplate(env));
7069

7170
t->InstanceTemplate()->SetInternalFieldCount(ECDH::kInternalFieldCount);
7271

src/crypto/crypto_hash.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ void Hash::Initialize(Environment* env, Local<Object> target) {
5757
Local<Context> context = env->context();
5858
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
5959

60-
t->InstanceTemplate()->SetInternalFieldCount(
61-
Hash::kInternalFieldCount);
62-
t->Inherit(BaseObject::GetConstructorTemplate(env));
60+
t->InstanceTemplate()->SetInternalFieldCount(Hash::kInternalFieldCount);
6361

6462
SetProtoMethod(isolate, t, "update", HashUpdate);
6563
SetProtoMethod(isolate, t, "digest", HashDigest);

src/crypto/crypto_hmac.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ void Hmac::Initialize(Environment* env, Local<Object> target) {
4141
Isolate* isolate = env->isolate();
4242
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
4343

44-
t->InstanceTemplate()->SetInternalFieldCount(
45-
Hmac::kInternalFieldCount);
46-
t->Inherit(BaseObject::GetConstructorTemplate(env));
44+
t->InstanceTemplate()->SetInternalFieldCount(Hmac::kInternalFieldCount);
4745

4846
SetProtoMethod(isolate, t, "init", HmacInit);
4947
SetProtoMethod(isolate, t, "update", HmacUpdate);

src/crypto/crypto_keys.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,6 @@ v8::Local<v8::Function> KeyObjectHandle::Initialize(Environment* env) {
901901
templ = NewFunctionTemplate(isolate, New);
902902
templ->InstanceTemplate()->SetInternalFieldCount(
903903
KeyObjectHandle::kInternalFieldCount);
904-
templ->Inherit(BaseObject::GetConstructorTemplate(env));
905904

906905
SetProtoMethod(isolate, templ, "init", Init);
907906
SetProtoMethodNoSideEffect(
@@ -1342,7 +1341,6 @@ void NativeKeyObject::CreateNativeKeyObjectClass(
13421341
NewFunctionTemplate(isolate, NativeKeyObject::New);
13431342
t->InstanceTemplate()->SetInternalFieldCount(
13441343
KeyObjectHandle::kInternalFieldCount);
1345-
t->Inherit(BaseObject::GetConstructorTemplate(env));
13461344

13471345
Local<Value> ctor;
13481346
if (!t->GetFunction(env->context()).ToLocal(&ctor))

src/crypto/crypto_sig.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,7 @@ void Sign::Initialize(Environment* env, Local<Object> target) {
329329
Isolate* isolate = env->isolate();
330330
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
331331

332-
t->InstanceTemplate()->SetInternalFieldCount(
333-
SignBase::kInternalFieldCount);
334-
t->Inherit(BaseObject::GetConstructorTemplate(env));
332+
t->InstanceTemplate()->SetInternalFieldCount(SignBase::kInternalFieldCount);
335333

336334
SetProtoMethod(isolate, t, "init", SignInit);
337335
SetProtoMethod(isolate, t, "update", SignUpdate);
@@ -459,9 +457,7 @@ void Verify::Initialize(Environment* env, Local<Object> target) {
459457
Isolate* isolate = env->isolate();
460458
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
461459

462-
t->InstanceTemplate()->SetInternalFieldCount(
463-
SignBase::kInternalFieldCount);
464-
t->Inherit(BaseObject::GetConstructorTemplate(env));
460+
t->InstanceTemplate()->SetInternalFieldCount(SignBase::kInternalFieldCount);
465461

466462
SetProtoMethod(isolate, t, "init", VerifyInit);
467463
SetProtoMethod(isolate, t, "update", VerifyUpdate);

src/crypto/crypto_x509.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ Local<FunctionTemplate> X509Certificate::GetConstructorTemplate(
5959
tmpl = NewFunctionTemplate(isolate, nullptr);
6060
tmpl->InstanceTemplate()->SetInternalFieldCount(
6161
BaseObject::kInternalFieldCount);
62-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
6362
tmpl->SetClassName(
6463
FIXED_ONE_BYTE_STRING(env->isolate(), "X509Certificate"));
6564
SetProtoMethod(isolate, tmpl, "subject", Subject);

src/env.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ void IsolateData::CreateProperties() {
480480
Local<FunctionTemplate> templ = FunctionTemplate::New(isolate());
481481
templ->InstanceTemplate()->SetInternalFieldCount(
482482
BaseObject::kInternalFieldCount);
483-
templ->Inherit(BaseObject::GetConstructorTemplate(this));
484483
set_binding_data_ctor_template(templ);
485484
binding::CreateInternalBindingTemplates(this);
486485

src/env_properties.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@
330330
#define PER_ISOLATE_TEMPLATE_PROPERTIES(V) \
331331
V(async_wrap_ctor_template, v8::FunctionTemplate) \
332332
V(async_wrap_object_ctor_template, v8::FunctionTemplate) \
333-
V(base_object_ctor_template, v8::FunctionTemplate) \
334333
V(binding_data_ctor_template, v8::FunctionTemplate) \
335334
V(blob_constructor_template, v8::FunctionTemplate) \
336335
V(blob_reader_constructor_template, v8::FunctionTemplate) \

src/histogram.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ Local<FunctionTemplate> HistogramBase::GetConstructorTemplate(
288288
tmpl = NewFunctionTemplate(isolate, New);
289289
Local<String> classname = FIXED_ONE_BYTE_STRING(isolate, "Histogram");
290290
tmpl->SetClassName(classname);
291-
tmpl->Inherit(BaseObject::GetConstructorTemplate(isolate_data));
292291

293292
tmpl->InstanceTemplate()->SetInternalFieldCount(
294293
HistogramBase::kInternalFieldCount);

src/module_wrap.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ void ModuleWrap::Initialize(Local<Object> target,
768768
Local<FunctionTemplate> tpl = NewFunctionTemplate(isolate, New);
769769
tpl->InstanceTemplate()->SetInternalFieldCount(
770770
ModuleWrap::kInternalFieldCount);
771-
tpl->Inherit(BaseObject::GetConstructorTemplate(env));
772771

773772
SetProtoMethod(isolate, tpl, "link", Link);
774773
SetProtoMethod(isolate, tpl, "instantiate", Instantiate);

src/node_binding.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,6 @@ void CreateInternalBindingTemplates(IsolateData* isolate_data) {
565565
FunctionTemplate::New(isolate_data->isolate()); \
566566
templ->InstanceTemplate()->SetInternalFieldCount( \
567567
BaseObject::kInternalFieldCount); \
568-
templ->Inherit(BaseObject::GetConstructorTemplate(isolate_data)); \
569568
_register_isolate_##modname(isolate_data, templ); \
570569
isolate_data->set_##modname##_binding(templ); \
571570
} while (0);

src/node_blob.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ Local<FunctionTemplate> Blob::GetConstructorTemplate(Environment* env) {
131131
tmpl = NewFunctionTemplate(isolate, nullptr);
132132
tmpl->InstanceTemplate()->SetInternalFieldCount(
133133
BaseObject::kInternalFieldCount);
134-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
135134
tmpl->SetClassName(
136135
FIXED_ONE_BYTE_STRING(env->isolate(), "Blob"));
137136
SetProtoMethod(isolate, tmpl, "getReader", GetReader);
@@ -281,7 +280,6 @@ Local<FunctionTemplate> Blob::Reader::GetConstructorTemplate(Environment* env) {
281280
tmpl = NewFunctionTemplate(isolate, nullptr);
282281
tmpl->InstanceTemplate()->SetInternalFieldCount(
283282
BaseObject::kInternalFieldCount);
284-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
285283
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "BlobReader"));
286284
SetProtoMethod(env->isolate(), tmpl, "pull", Pull);
287285
env->set_blob_reader_constructor_template(tmpl);

src/node_i18n.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,6 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
875875
// ConverterObject
876876
{
877877
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, nullptr);
878-
t->Inherit(BaseObject::GetConstructorTemplate(isolate_data));
879878
t->InstanceTemplate()->SetInternalFieldCount(
880879
ConverterObject::kInternalFieldCount);
881880
Local<String> converter_string =

src/node_messaging.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class SerializerDelegate : public ValueSerializer::Delegate {
301301
}
302302

303303
Maybe<bool> WriteHostObject(Isolate* isolate, Local<Object> object) override {
304-
if (env_->base_object_ctor_template()->HasInstance(object)) {
304+
if (BaseObject::IsBaseObject(object)) {
305305
return WriteHostObject(
306306
BaseObjectPtr<BaseObject> { Unwrap<BaseObject>(object) });
307307
}
@@ -490,7 +490,8 @@ Maybe<bool> Message::Serialize(Environment* env,
490490
array_buffers.push_back(ab);
491491
serializer.TransferArrayBuffer(id, ab);
492492
continue;
493-
} else if (env->base_object_ctor_template()->HasInstance(entry)) {
493+
} else if (entry->IsObject() &&
494+
BaseObject::IsBaseObject(entry.As<Object>())) {
494495
// Check if the source MessagePort is being transferred.
495496
if (!source_port.IsEmpty() && entry == source_port) {
496497
ThrowDataCloneException(
@@ -1257,7 +1258,7 @@ JSTransferable::NestedTransferables() const {
12571258
Local<Value> value;
12581259
if (!list->Get(context, i).ToLocal(&value))
12591260
return Nothing<BaseObjectList>();
1260-
if (env()->base_object_ctor_template()->HasInstance(value))
1261+
if (value->IsObject() && BaseObject::IsBaseObject(value.As<Object>()))
12611262
ret.emplace_back(Unwrap<BaseObject>(value));
12621263
}
12631264
return Just(ret);
@@ -1309,9 +1310,10 @@ BaseObjectPtr<BaseObject> JSTransferable::Data::Deserialize(
13091310

13101311
Local<Value> ret;
13111312
CHECK(!env->messaging_deserialize_create_object().IsEmpty());
1312-
if (!env->messaging_deserialize_create_object()->Call(
1313-
context, Null(env->isolate()), 1, &info).ToLocal(&ret) ||
1314-
!env->base_object_ctor_template()->HasInstance(ret)) {
1313+
if (!env->messaging_deserialize_create_object()
1314+
->Call(context, Null(env->isolate()), 1, &info)
1315+
.ToLocal(&ret) ||
1316+
!ret->IsObject() || !BaseObject::IsBaseObject(ret.As<Object>())) {
13151317
return {};
13161318
}
13171319

@@ -1492,7 +1494,6 @@ static void InitMessaging(Local<Object> target,
14921494
{
14931495
Local<FunctionTemplate> t =
14941496
NewFunctionTemplate(isolate, JSTransferable::New);
1495-
t->Inherit(BaseObject::GetConstructorTemplate(env));
14961497
t->InstanceTemplate()->SetInternalFieldCount(
14971498
JSTransferable::kInternalFieldCount);
14981499
SetConstructorFunction(context, target, "JSTransferable", t);

src/node_serdes.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ void Initialize(Local<Object> target,
462462

463463
ser->InstanceTemplate()->SetInternalFieldCount(
464464
SerializerContext::kInternalFieldCount);
465-
ser->Inherit(BaseObject::GetConstructorTemplate(env));
466465

467466
SetProtoMethod(isolate, ser, "writeHeader", SerializerContext::WriteHeader);
468467
SetProtoMethod(isolate, ser, "writeValue", SerializerContext::WriteValue);
@@ -490,7 +489,6 @@ void Initialize(Local<Object> target,
490489

491490
des->InstanceTemplate()->SetInternalFieldCount(
492491
DeserializerContext::kInternalFieldCount);
493-
des->Inherit(BaseObject::GetConstructorTemplate(env));
494492

495493
SetProtoMethod(isolate, des, "readHeader", DeserializerContext::ReadHeader);
496494
SetProtoMethod(isolate, des, "readValue", DeserializerContext::ReadValue);

src/node_snapshotable.cc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,18 +1369,7 @@ StartupData SerializeNodeContextInternalFields(Local<Object> holder,
13691369
// (most importantly, BaseObject::kSlot).
13701370
// For Node.js this design is enough for all the native binding that are
13711371
// serializable.
1372-
if (index != BaseObject::kEmbedderType) {
1373-
return StartupData{nullptr, 0};
1374-
}
1375-
1376-
void* type_ptr = holder->GetAlignedPointerFromInternalField(index);
1377-
if (type_ptr == nullptr) {
1378-
return StartupData{nullptr, 0};
1379-
}
1380-
1381-
uint16_t type = *(static_cast<uint16_t*>(type_ptr));
1382-
per_process::Debug(DebugCategory::MKSNAPSHOT, "type = 0x%x\n", type);
1383-
if (type != kNodeEmbedderId) {
1372+
if (index != BaseObject::kEmbedderType || !BaseObject::IsBaseObject(holder)) {
13841373
return StartupData{nullptr, 0};
13851374
}
13861375

src/node_sockaddr.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,6 @@ Local<FunctionTemplate> SocketAddressBlockListWrap::GetConstructorTemplate(
701701
Isolate* isolate = env->isolate();
702702
tmpl = NewFunctionTemplate(isolate, SocketAddressBlockListWrap::New);
703703
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "BlockList"));
704-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
705704
tmpl->InstanceTemplate()->SetInternalFieldCount(kInternalFieldCount);
706705
SetProtoMethod(isolate, tmpl, "addAddress", AddAddress);
707706
SetProtoMethod(isolate, tmpl, "addRange", AddRange);
@@ -757,7 +756,6 @@ Local<FunctionTemplate> SocketAddressBase::GetConstructorTemplate(
757756
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "SocketAddress"));
758757
tmpl->InstanceTemplate()->SetInternalFieldCount(
759758
SocketAddressBase::kInternalFieldCount);
760-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
761759
SetProtoMethod(isolate, tmpl, "detail", Detail);
762760
SetProtoMethod(isolate, tmpl, "legacyDetail", LegacyDetail);
763761
SetProtoMethodNoSideEffect(isolate, tmpl, "flowlabel", GetFlowLabel);

src/node_trace_events.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ void NodeCategorySet::Initialize(Local<Object> target,
137137
NewFunctionTemplate(isolate, NodeCategorySet::New);
138138
category_set->InstanceTemplate()->SetInternalFieldCount(
139139
NodeCategorySet::kInternalFieldCount);
140-
category_set->Inherit(BaseObject::GetConstructorTemplate(env));
141140
SetProtoMethod(isolate, category_set, "enable", NodeCategorySet::Enable);
142141
SetProtoMethod(isolate, category_set, "disable", NodeCategorySet::Disable);
143142

src/node_util.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ void Initialize(Local<Object> target,
468468
NewFunctionTemplate(isolate, WeakReference::New);
469469
weak_ref->InstanceTemplate()->SetInternalFieldCount(
470470
WeakReference::kInternalFieldCount);
471-
weak_ref->Inherit(BaseObject::GetConstructorTemplate(env));
472471
SetProtoMethod(isolate, weak_ref, "get", WeakReference::Get);
473472
SetProtoMethod(isolate, weak_ref, "getRef", WeakReference::GetRef);
474473
SetProtoMethod(isolate, weak_ref, "incRef", WeakReference::IncRef);

src/node_wasi.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,6 @@ static void InitializePreview1(Local<Object> target,
12711271

12721272
Local<FunctionTemplate> tmpl = NewFunctionTemplate(isolate, WASI::New);
12731273
tmpl->InstanceTemplate()->SetInternalFieldCount(WASI::kInternalFieldCount);
1274-
tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
12751274

12761275
#define V(F, name) \
12771276
SetFunction<decltype(&WASI::F), WASI::F>(WASI::F, env, name, tmpl);

src/node_wasm_web_api.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Local<Function> WasmStreamingObject::Initialize(Environment* env) {
2828

2929
Isolate* isolate = env->isolate();
3030
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
31-
t->Inherit(BaseObject::GetConstructorTemplate(env));
3231
t->InstanceTemplate()->SetInternalFieldCount(
3332
WasmStreamingObject::kInternalFieldCount);
3433

0 commit comments

Comments
 (0)