Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ea87eea
module: fix extensionless CJS files in `"type": "module"` packages
mcollina Mar 10, 2026
f2c08c7
src: use validate_ascii_with_errors instead of validate_ascii
ChALkeR Mar 2, 2026
cc46204
doc: include url.resolve() in DEP0169 application deprecation
MikeMcC399 Mar 2, 2026
8048e05
test: fix skipping behavior for `test-runner-run-files-undefined`
aduh95 Mar 2, 2026
f90fa9c
stream: accept ArrayBuffer in CompressionStream and DecompressionStream
suuuuuuminnnnnn Mar 2, 2026
851228c
sqlite: handle stmt invalidation
araujogui Mar 2, 2026
80f78f2
test: update WPT for WebCryptoAPI to 42e47329fd
nodejs-github-bot Mar 3, 2026
d55a441
doc: add title to index
avivkeller Mar 3, 2026
09191ad
deps: update ada to 3.4.3
nodejs-github-bot Mar 3, 2026
975dafb
src: release context frame in AsyncWrap::EmitDestroy
Flarna Mar 3, 2026
1d91a72
doc,module: add missing doc for syncHooks.deregister()
joyeecheung Mar 3, 2026
bab750d
build: do not depend on V8 deps on `--without-bundled-v8` builds
aduh95 Mar 3, 2026
92f3b42
tools: bump eslint to v10, babel to v8.0.0-rc.2
JLHwung Mar 3, 2026
5b266f3
meta: bump step-security/harden-runner from 2.14.2 to 2.15.0
dependabot[bot] Mar 3, 2026
f8793f8
lib: fix source map url parse in dynamic imports
legendecas Mar 3, 2026
772d3d2
tools: bump minimatch from 3.1.3 to 3.1.5 in /tools/clang-format
dependabot[bot] Mar 3, 2026
db150b2
doc: fix markdown for `expectFailure` values
JakobJingleheimer Mar 4, 2026
5632446
stream: fix TransformStream race on cancel with pending write
marcopiraccini Mar 4, 2026
3e8c816
tools: fix example in release proposal linter
richardlau Mar 4, 2026
7d0b758
tools: fix daily wpt workflow nighly release version lookup
panva Mar 4, 2026
dcb1cbb
tools: bump the eslint group across 1 directory with 2 updates
dependabot[bot] Mar 5, 2026
a5b1be2
stream: fix UTF-8 character corruption in fast-utf8-stream
mcollina Mar 5, 2026
5198573
http: fix use-after-free when freeParser is called during llhttp_execute
Flarna Mar 6, 2026
6f975db
crypto: fix importKey required argument count check
panva Mar 4, 2026
e362635
crypto: add missing AES dictionaries
panva Mar 4, 2026
b26d1c7
crypto: make --use-system-ca per-env rather than per-process
Aditi-1400 Mar 6, 2026
710dde5
tools: fix `--node-builtin-modules-path` value in `shell.nix`
aduh95 Mar 6, 2026
eeee7c7
doc: add efekrskl as triager
efekrskl Mar 6, 2026
0257e80
src: make AsyncWrap subclass internal field counts explicit
addaleax Mar 3, 2026
19efe60
src: expose async context frame debugging helper to JS
addaleax Mar 3, 2026
cfc847d
test: update WPT compression to ae05f5cb53
panva Mar 4, 2026
82770cb
test: improve WPT report runner
panva Mar 4, 2026
4bdcaf2
stream: improve Web Compression spec compliance
panva Mar 4, 2026
4d62e95
stream: fix brotli error handling in web compression streams
panva Mar 4, 2026
1a453b5
tools: improve error handling in test426 update script
Trott Mar 7, 2026
27fd219
meta: bump actions/upload-artifact from 6.0.0 to 7.0.0
dependabot[bot] Mar 8, 2026
5439d0e
meta: bump actions/download-artifact from 7.0.0 to 8.0.0
dependabot[bot] Mar 8, 2026
83719ff
doc: correct `util.convertProcessSignalToExitCode` validation behavior
Renegade334 Mar 8, 2026
deead95
url: suppress warnings from url.format/url.resolve inside node_modules
Renegade334 Mar 8, 2026
0278461
stream: optimize webstreams pipeTo
MattiasBuelens Mar 9, 2026
37862a6
deps: V8: cherry-pick aa0b288f87cc
richardlau Mar 9, 2026
699a621
tools: revert timezone update GHA workflow to ubuntu-latest
richardlau Mar 9, 2026
8d63a17
doc: copyedit `addons.md`
aduh95 Mar 9, 2026
2c85057
deps: patch resb crate
richardlau Mar 9, 2026
456abc7
test: update WPT for WebCryptoAPI to c9e955840a
nodejs-github-bot Mar 10, 2026
00319ea
test: update WPT for url to c928b19ab0
nodejs-github-bot Mar 10, 2026
a13ed05
deps: update merve to 1.2.0
nodejs-github-bot Mar 10, 2026
53afb0e
deps: update sqlite to 3.52.0
nodejs-github-bot Mar 10, 2026
3beaf9c
deps: update amaro to 1.1.8
nodejs-github-bot Mar 10, 2026
2ea7a7b
2026-03-11, Version 25.8.1 (Current)
nodejs-github-bot Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
src: make AsyncWrap subclass internal field counts explicit
This helps ensure that we already set the correct number of
internal fields when creating objects, even if the number of
internal fields of e.g. AsyncWrap changes over time.

PR-URL: #62103
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
  • Loading branch information
addaleax authored and aduh95 committed Mar 10, 2026
commit 0257e8072f93894e1173ab74e0b2d8981bc3baf4
9 changes: 9 additions & 0 deletions src/async_wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ inline v8::Local<v8::FunctionTemplate> AsyncWrap::GetConstructorTemplate(
return GetConstructorTemplate(env->isolate_data());
}

// static
v8::Local<v8::FunctionTemplate> AsyncWrap::MakeLazilyInitializedJSTemplate(
Environment* env, int internal_field_count) {
v8::Local<v8::FunctionTemplate> t =
BaseObject::MakeLazilyInitializedJSTemplate(env, internal_field_count);
t->Inherit(AsyncWrap::GetConstructorTemplate(env));
return t;
}

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
Expand Down
7 changes: 7 additions & 0 deletions src/async_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ class ExternalReferenceRegistry;

class AsyncWrap : public BaseObject {
public:
enum InternalFields {
kInternalFieldCount = BaseObject::kInternalFieldCount,
};

enum ProviderType {
#define V(PROVIDER) \
PROVIDER_ ## PROVIDER,
Expand Down Expand Up @@ -229,6 +233,9 @@ class AsyncWrap : public BaseObject {

bool IsDoneInitializing() const override;

static inline v8::Local<v8::FunctionTemplate> MakeLazilyInitializedJSTemplate(
Environment* env, int internal_field_count = kInternalFieldCount);

private:
ProviderType provider_type_ = PROVIDER_NONE;
bool init_hook_ran_ = false;
Expand Down
9 changes: 5 additions & 4 deletions src/base_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ void BaseObject::LazilyInitializedJSTemplateConstructor(
}

Local<FunctionTemplate> BaseObject::MakeLazilyInitializedJSTemplate(
Environment* env) {
return MakeLazilyInitializedJSTemplate(env->isolate_data());
Environment* env, int internal_field_count) {
return MakeLazilyInitializedJSTemplate(env->isolate_data(),
internal_field_count);
}

Local<FunctionTemplate> BaseObject::MakeLazilyInitializedJSTemplate(
IsolateData* isolate_data) {
IsolateData* isolate_data, int internal_field_count) {
Local<FunctionTemplate> t = NewFunctionTemplate(
isolate_data->isolate(), LazilyInitializedJSTemplateConstructor);
t->InstanceTemplate()->SetInternalFieldCount(BaseObject::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(internal_field_count);
return t;
}

Expand Down
4 changes: 2 additions & 2 deletions src/base_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ class BaseObject : public MemoryRetainer {
// the `BaseObject*` pointer) and a constructor that initializes that field
// to `nullptr`.
static v8::Local<v8::FunctionTemplate> MakeLazilyInitializedJSTemplate(
IsolateData* isolate);
IsolateData* isolate, int internal_field_count = kInternalFieldCount);
static v8::Local<v8::FunctionTemplate> MakeLazilyInitializedJSTemplate(
Environment* env);
Environment* env, int internal_field_count = kInternalFieldCount);

// Setter/Getter pair for internal fields that can be passed to SetAccessor.
template <int Field>
Expand Down
12 changes: 3 additions & 9 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2318,19 +2318,13 @@ void Initialize(Local<Object> target,
NODE_DEFINE_CONSTANT(target, DNS_ORDER_IPV4_FIRST);
NODE_DEFINE_CONSTANT(target, DNS_ORDER_IPV6_FIRST);

Local<FunctionTemplate> aiw =
BaseObject::MakeLazilyInitializedJSTemplate(env);
aiw->Inherit(AsyncWrap::GetConstructorTemplate(env));
Local<FunctionTemplate> aiw = AsyncWrap::MakeLazilyInitializedJSTemplate(env);
SetConstructorFunction(context, target, "GetAddrInfoReqWrap", aiw);

Local<FunctionTemplate> niw =
BaseObject::MakeLazilyInitializedJSTemplate(env);
niw->Inherit(AsyncWrap::GetConstructorTemplate(env));
Local<FunctionTemplate> niw = AsyncWrap::MakeLazilyInitializedJSTemplate(env);
SetConstructorFunction(context, target, "GetNameInfoReqWrap", niw);

Local<FunctionTemplate> qrw =
BaseObject::MakeLazilyInitializedJSTemplate(env);
qrw->Inherit(AsyncWrap::GetConstructorTemplate(env));
Local<FunctionTemplate> qrw = AsyncWrap::MakeLazilyInitializedJSTemplate(env);
SetConstructorFunction(context, target, "QueryReqWrap", qrw);

Local<FunctionTemplate> channel_wrap =
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_keys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ void NativeKeyObject::CreateNativeKeyObjectClass(
Local<FunctionTemplate> t =
NewFunctionTemplate(isolate, NativeKeyObject::New);
t->InstanceTemplate()->SetInternalFieldCount(
KeyObjectHandle::kInternalFieldCount);
NativeKeyObject::kInternalFieldCount);

Local<Value> ctor;
if (!t->GetFunction(env->context()).ToLocal(&ctor))
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/crypto_sig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void Sign::Initialize(Environment* env, Local<Object> target) {
Isolate* isolate = env->isolate();
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);

t->InstanceTemplate()->SetInternalFieldCount(SignBase::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(Sign::kInternalFieldCount);

SetProtoMethod(isolate, t, "init", SignInit);
SetProtoMethod(isolate, t, "update", SignUpdate);
Expand Down Expand Up @@ -437,7 +437,7 @@ void Verify::Initialize(Environment* env, Local<Object> target) {
Isolate* isolate = env->isolate();
Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);

t->InstanceTemplate()->SetInternalFieldCount(SignBase::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(Verify::kInternalFieldCount);

SetProtoMethod(isolate, t, "init", VerifyInit);
SetProtoMethod(isolate, t, "update", VerifyUpdate);
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/crypto_tls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2172,11 +2172,11 @@ void TLSWrap::Initialize(

NODE_DEFINE_CONSTANT(target, HAVE_SSL_TRACE);

Local<FunctionTemplate> t = BaseObject::MakeLazilyInitializedJSTemplate(env);
Local<FunctionTemplate> t = AsyncWrap::MakeLazilyInitializedJSTemplate(env);
Local<String> tlsWrapString =
FIXED_ONE_BYTE_STRING(env->isolate(), "TLSWrap");
t->SetClassName(tlsWrapString);
t->InstanceTemplate()->SetInternalFieldCount(StreamBase::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(TLSWrap::kInternalFieldCount);

Local<FunctionTemplate> get_write_queue_size =
FunctionTemplate::New(env->isolate(),
Expand Down
5 changes: 5 additions & 0 deletions src/crypto/crypto_tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class TLSWrap : public AsyncWrap,
public StreamBase,
public StreamListener {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(AsyncWrap::kInternalFieldCount,
StreamBase::kInternalFieldCount),
};

enum class Kind {
kClient,
kServer
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class CryptoJob : public AsyncWrap, public ThreadPoolWork {
v8::Local<v8::FunctionTemplate> job = NewFunctionTemplate(isolate, new_fn);
job->Inherit(AsyncWrap::GetConstructorTemplate(env));
job->InstanceTemplate()->SetInternalFieldCount(
AsyncWrap::kInternalFieldCount);
CryptoJob::kInternalFieldCount);
SetProtoMethod(isolate, job, "run", Run);
SetConstructorFunction(context, target, CryptoJobTraits::JobName, job);
}
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_x509.cc
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ Local<FunctionTemplate> X509Certificate::GetConstructorTemplate(
Isolate* isolate = env->isolate();
tmpl = NewFunctionTemplate(isolate, nullptr);
tmpl->InstanceTemplate()->SetInternalFieldCount(
BaseObject::kInternalFieldCount);
X509Certificate::kInternalFieldCount);
tmpl->SetClassName(
FIXED_ONE_BYTE_STRING(env->isolate(), "X509Certificate"));
SetProtoMethodNoSideEffect(isolate, tmpl, "subject", Subject);
Expand Down
7 changes: 6 additions & 1 deletion src/heap_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ class HeapSnapshotStream : public AsyncWrap,
public StreamBase,
public v8::OutputStream {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(AsyncWrap::kInternalFieldCount,
StreamBase::kInternalFieldCount),
};

HeapSnapshotStream(
Environment* env,
HeapSnapshotPointer&& snapshot,
Expand Down Expand Up @@ -401,7 +406,7 @@ BaseObjectPtr<AsyncWrap> CreateHeapSnapshotStream(
Local<FunctionTemplate> os = FunctionTemplate::New(env->isolate());
os->Inherit(AsyncWrap::GetConstructorTemplate(env));
Local<ObjectTemplate> ost = os->InstanceTemplate();
ost->SetInternalFieldCount(StreamBase::kInternalFieldCount);
ost->SetInternalFieldCount(HeapSnapshotStream::kInternalFieldCount);
os->SetClassName(
FIXED_ONE_BYTE_STRING(env->isolate(), "HeapSnapshotStream"));
StreamBase::AddMethods(env, os);
Expand Down
4 changes: 2 additions & 2 deletions src/histogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Local<FunctionTemplate> HistogramBase::GetConstructorTemplate(
Local<String> classname = FIXED_ONE_BYTE_STRING(isolate, "Histogram");
tmpl->SetClassName(classname);
auto instance = tmpl->InstanceTemplate();
instance->SetInternalFieldCount(HistogramImpl::kInternalFieldCount);
instance->SetInternalFieldCount(HistogramBase::kInternalFieldCount);
SetFastMethod(isolate, instance, "record", Record, &fast_record_);
SetFastMethod(
isolate, instance, "recordDelta", RecordDelta, &fast_record_delta_);
Expand Down Expand Up @@ -326,7 +326,7 @@ Local<FunctionTemplate> IntervalHistogram::GetConstructorTemplate(
tmpl->Inherit(HandleWrap::GetConstructorTemplate(env));
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(isolate, "Histogram"));
auto instance = tmpl->InstanceTemplate();
instance->SetInternalFieldCount(HistogramImpl::kInternalFieldCount);
instance->SetInternalFieldCount(IntervalHistogram::kInternalFieldCount);
HistogramImpl::AddMethods(isolate, tmpl);
SetFastMethod(isolate, instance, "start", Start, &fast_start_);
SetFastMethod(isolate, instance, "stop", Stop, &fast_stop_);
Expand Down
12 changes: 11 additions & 1 deletion src/histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class HistogramImpl {
public:
enum InternalFields {
kSlot = BaseObject::kSlot,
kImplField = BaseObject::kInternalFieldCount,
kImplField = HandleWrap::kInternalFieldCount,
kInternalFieldCount
};

Expand Down Expand Up @@ -133,6 +133,11 @@ class HistogramImpl {

class HistogramBase final : public BaseObject, public HistogramImpl {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(
BaseObject::kInternalFieldCount, HistogramImpl::kInternalFieldCount),
};

static v8::Local<v8::FunctionTemplate> GetConstructorTemplate(
IsolateData* isolate_data);
static void Initialize(IsolateData* isolate_data,
Expand Down Expand Up @@ -203,6 +208,11 @@ class HistogramBase final : public BaseObject, public HistogramImpl {

class IntervalHistogram final : public HandleWrap, public HistogramImpl {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(
HandleWrap::kInternalFieldCount, HistogramImpl::kInternalFieldCount),
};

enum class StartFlags {
NONE,
RESET
Expand Down
3 changes: 1 addition & 2 deletions src/js_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ void JSStream::Initialize(Local<Object> target,
Isolate* isolate = env->isolate();

Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
t->InstanceTemplate()
->SetInternalFieldCount(StreamBase::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(JSStream::kInternalFieldCount);
t->Inherit(AsyncWrap::GetConstructorTemplate(env));

SetProtoMethod(isolate, t, "finishWrite", Finish<WriteWrap>);
Expand Down
5 changes: 5 additions & 0 deletions src/js_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class Environment;

class JSStream : public AsyncWrap, public StreamBase {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(AsyncWrap::kInternalFieldCount,
StreamBase::kInternalFieldCount),
};

static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
Expand Down
5 changes: 2 additions & 3 deletions src/node_blob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ Local<FunctionTemplate> Blob::GetConstructorTemplate(Environment* env) {
if (tmpl.IsEmpty()) {
Isolate* isolate = env->isolate();
tmpl = NewFunctionTemplate(isolate, nullptr);
tmpl->InstanceTemplate()->SetInternalFieldCount(
BaseObject::kInternalFieldCount);
tmpl->InstanceTemplate()->SetInternalFieldCount(Blob::kInternalFieldCount);
tmpl->SetClassName(
FIXED_ONE_BYTE_STRING(env->isolate(), "Blob"));
SetProtoMethod(isolate, tmpl, "getReader", GetReader);
Expand Down Expand Up @@ -318,7 +317,7 @@ Local<FunctionTemplate> Blob::Reader::GetConstructorTemplate(Environment* env) {
Isolate* isolate = env->isolate();
tmpl = NewFunctionTemplate(isolate, nullptr);
tmpl->InstanceTemplate()->SetInternalFieldCount(
BaseObject::kInternalFieldCount);
Blob::Reader::kInternalFieldCount);
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "BlobReader"));
SetProtoMethod(env->isolate(), tmpl, "pull", Pull);
env->set_blob_reader_constructor_template(tmpl);
Expand Down
3 changes: 2 additions & 1 deletion src/node_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ class FileHandleReadWrap final : public ReqWrap<uv_fs_t> {
class FileHandle final : public AsyncWrap, public StreamBase {
public:
enum InternalFields {
kFileHandleBaseField = StreamBase::kInternalFieldCount,
kFileHandleBaseField = std::max<uint32_t>(AsyncWrap::kInternalFieldCount,
StreamBase::kInternalFieldCount),
kClosingPromiseSlot,
kInternalFieldCount
};
Expand Down
4 changes: 2 additions & 2 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3476,7 +3476,7 @@ void Initialize(Local<Object> target,
Local<FunctionTemplate> setting = FunctionTemplate::New(env->isolate());
setting->Inherit(AsyncWrap::GetConstructorTemplate(env));
Local<ObjectTemplate> settingt = setting->InstanceTemplate();
settingt->SetInternalFieldCount(AsyncWrap::kInternalFieldCount);
settingt->SetInternalFieldCount(Http2Settings::kInternalFieldCount);
env->set_http2settings_constructor_template(settingt);

Local<FunctionTemplate> stream = FunctionTemplate::New(env->isolate());
Expand All @@ -3492,7 +3492,7 @@ void Initialize(Local<Object> target,
stream->Inherit(AsyncWrap::GetConstructorTemplate(env));
StreamBase::AddMethods(env, stream);
Local<ObjectTemplate> streamt = stream->InstanceTemplate();
streamt->SetInternalFieldCount(StreamBase::kInternalFieldCount);
streamt->SetInternalFieldCount(Http2Stream::kInternalFieldCount);
env->set_http2stream_constructor_template(streamt);
SetConstructorFunction(context, target, "Http2Stream", stream);

Expand Down
5 changes: 5 additions & 0 deletions src/node_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ using Http2Header = NgHeader<Http2HeaderTraits>;
class Http2Stream : public AsyncWrap,
public StreamBase {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(AsyncWrap::kInternalFieldCount,
StreamBase::kInternalFieldCount),
};

static Http2Stream* New(
Http2Session* session,
int32_t id,
Expand Down
6 changes: 6 additions & 0 deletions src/node_postmortem_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
extern "C" {
int nodedbg_const_ContextEmbedderIndex__kEnvironment__int;
int nodedbg_const_BaseObject__kInternalFieldCount__int;
int nodedbg_const_HandleWrap__kInternalFieldCount__int;
int nodedbg_const_ReqWrap__kInternalFieldCount__int;
uintptr_t nodedbg_offset_ExternalString__data__uintptr_t;
uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;

Expand All @@ -54,6 +56,10 @@ int GenDebugSymbols() {
ContextEmbedderIndex::kEnvironment;
nodedbg_const_BaseObject__kInternalFieldCount__int =
BaseObject::kInternalFieldCount;
nodedbg_const_HandleWrap__kInternalFieldCount__int =
HandleWrap::kInternalFieldCount;
nodedbg_const_ReqWrap__kInternalFieldCount__int =
ReqWrap<uv_req_t>::kInternalFieldCount;

nodedbg_offset_ExternalString__data__uintptr_t = NODE_OFF_EXTSTR_DATA;
nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue =
Expand Down
2 changes: 1 addition & 1 deletion src/node_sqlite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3450,7 +3450,7 @@ Local<FunctionTemplate> StatementSyncIterator::GetConstructorTemplate(
tmpl = NewFunctionTemplate(isolate, IllegalConstructor);
tmpl->SetClassName(FIXED_ONE_BYTE_STRING(isolate, "StatementSyncIterator"));
tmpl->InstanceTemplate()->SetInternalFieldCount(
StatementSync::kInternalFieldCount);
StatementSyncIterator::kInternalFieldCount);
SetProtoMethod(isolate, tmpl, "next", StatementSyncIterator::Next);
SetProtoMethod(isolate, tmpl, "return", StatementSyncIterator::Return);
env->set_sqlite_statement_sync_iterator_constructor_template(tmpl);
Expand Down
2 changes: 1 addition & 1 deletion src/node_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ void Initialize(Local<Object> target,
// GCProfiler
Local<FunctionTemplate> t =
NewFunctionTemplate(env->isolate(), GCProfiler::New);
t->InstanceTemplate()->SetInternalFieldCount(BaseObject::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(GCProfiler::kInternalFieldCount);
SetProtoMethod(env->isolate(), t, "start", GCProfiler::Start);
SetProtoMethod(env->isolate(), t, "stop", GCProfiler::Stop);
SetConstructorFunction(context, target, "GCProfiler", t);
Expand Down
5 changes: 2 additions & 3 deletions src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void PipeWrap::Initialize(Local<Object> target,
Isolate* isolate = env->isolate();

Local<FunctionTemplate> t = NewFunctionTemplate(isolate, New);
t->InstanceTemplate()->SetInternalFieldCount(StreamBase::kInternalFieldCount);
t->InstanceTemplate()->SetInternalFieldCount(PipeWrap::kInternalFieldCount);

t->Inherit(LibuvStreamWrap::GetConstructorTemplate(env));

Expand All @@ -91,8 +91,7 @@ void PipeWrap::Initialize(Local<Object> target,
env->set_pipe_constructor_template(t);

// Create FunctionTemplate for PipeConnectWrap.
auto cwt = BaseObject::MakeLazilyInitializedJSTemplate(env);
cwt->Inherit(AsyncWrap::GetConstructorTemplate(env));
auto cwt = AsyncWrap::MakeLazilyInitializedJSTemplate(env);
SetConstructorFunction(context, target, "PipeConnectWrap", cwt);

// Define constants
Expand Down
5 changes: 5 additions & 0 deletions src/quic/logstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ namespace node::quic {
// and Keylog diagnostic data (one instance for each).
class LogStream final : public AsyncWrap, public StreamBase {
public:
enum InternalFields {
kInternalFieldCount = std::max<uint32_t>(AsyncWrap::kInternalFieldCount,
StreamBase::kInternalFieldCount),
};

JS_CONSTRUCTOR(LogStream);

static BaseObjectPtr<LogStream> Create(Environment* env);
Expand Down
Loading