diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 0e3f39559984be..2d1152d1c0324b 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -452,7 +452,8 @@ Local AsyncWrap::GetConstructorTemplate(Environment* env) { void AsyncWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); HandleScope scope(isolate); diff --git a/src/async_wrap.h b/src/async_wrap.h index e3d5748bbc6077..523d620b0acb52 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -116,7 +116,8 @@ class AsyncWrap : public BaseObject { static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); static void GetAsyncId(const v8::FunctionCallbackInfo& args); static void PushAsyncIds(const v8::FunctionCallbackInfo& args); diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 93c1035617958b..2c8212177b41fa 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -171,7 +171,8 @@ namespace symbols { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); #define V(PropertyName, StringValue) \ target->Set(env->context(), \ diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index e5d0319fa17373..a3bcdf89535935 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -2172,7 +2172,8 @@ void StrError(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "getaddrinfo", GetAddrInfo); diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 057445776a5255..249a4bb973cbd7 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -52,7 +52,8 @@ class FSEventWrap: public HandleWrap { public: static void Initialize(Local target, Local unused, - Local context); + Local context, + void* priv); static void New(const FunctionCallbackInfo& args); static void Start(const FunctionCallbackInfo& args); static void GetInitialized(const FunctionCallbackInfo& args); @@ -95,7 +96,8 @@ void FSEventWrap::GetInitialized(const FunctionCallbackInfo& args) { void FSEventWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); auto fsevent_string = FIXED_ONE_BYTE_STRING(env->isolate(), "FSEvent"); diff --git a/src/heap_utils.cc b/src/heap_utils.cc index d1e3fad0980280..84cbf07c1ee72e 100644 --- a/src/heap_utils.cc +++ b/src/heap_utils.cc @@ -247,7 +247,8 @@ void CreateHeapDump(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethodNoSideEffect(target, "buildEmbedderGraph", BuildEmbedderGraph); diff --git a/src/js_stream.cc b/src/js_stream.cc index 31e15ec308326b..e4137079fa5aca 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -196,7 +196,8 @@ void JSStream::EmitEOF(const FunctionCallbackInfo& args) { void JSStream::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); diff --git a/src/js_stream.h b/src/js_stream.h index 6612e558aea1d7..482373016d01bd 100644 --- a/src/js_stream.h +++ b/src/js_stream.h @@ -14,7 +14,8 @@ class JSStream : public AsyncWrap, public StreamBase { public: static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); bool IsAlive() override; bool IsClosing() override; diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 9a3c1cb2e2c26e..3860ec745e0311 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -821,7 +821,8 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( void ModuleWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); diff --git a/src/module_wrap.h b/src/module_wrap.h index 0e352c657580e4..6d231631d6a69e 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -38,7 +38,8 @@ class ModuleWrap : public BaseObject { static const std::string EXTENSIONS[]; static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); static void HostInitializeImportMetaObjectCallback( v8::Local context, v8::Local module, diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 2a2fb45e7abf15..2c1bedaadaeef8 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1083,7 +1083,8 @@ void SetupBufferJS(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "setupBufferJS", SetupBufferJS); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index f12d5e7d66724c..fc89f58f8bef65 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1075,7 +1075,8 @@ void ContextifyContext::CompileFunction( void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); ContextifyContext::Init(env, target); ContextifyScript::Init(env, target); diff --git a/src/node_domain.cc b/src/node_domain.cc index f4f585ac4f43e2..b29ca1db0575a1 100644 --- a/src/node_domain.cc +++ b/src/node_domain.cc @@ -22,7 +22,8 @@ void Enable(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "enable", Enable); diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 77763229ce44de..6e5f08e35451f0 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -317,7 +317,8 @@ MaybeLocal NativeModuleLoader::LookupAndCompile( void NativeModuleLoader::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod( diff --git a/src/node_native_module.h b/src/node_native_module.h index 76725ec0f2825b..fc0e33c73500d1 100644 --- a/src/node_native_module.h +++ b/src/node_native_module.h @@ -37,7 +37,8 @@ class NativeModuleLoader { NativeModuleLoader(); static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); v8::Local GetSourceObject(v8::Local context) const; v8::Local GetSource(v8::Isolate* isolate, const char* id) const; diff --git a/src/node_options.cc b/src/node_options.cc index 98beb9f4c66b9a..0551ffadfda206 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -472,7 +472,8 @@ void GetOptions(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); env->SetMethodNoSideEffect(target, "getOptions", GetOptions); diff --git a/src/node_os.cc b/src/node_os.cc index fa38040e3af64a..77693a47ec901f 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -446,7 +446,8 @@ static void GetPriority(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "getHostname", GetHostname); env->SetMethod(target, "getLoadAvg", GetLoadAvg); diff --git a/src/node_perf.cc b/src/node_perf.cc index 5881b2be69a664..2b7faccec9a71b 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -376,7 +376,8 @@ void Timerify(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); performance_state* state = env->performance_state(); diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 631b8ed95b81e0..5d5d002e9dd683 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -440,7 +440,8 @@ void DeserializerContext::ReadRawBytes( void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local ser = env->NewFunctionTemplate(SerializerContext::New); diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 94ed1ec5a1de5b..1dfb1de2fcea1e 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -21,6 +21,11 @@ using v8::Value; class NodeCategorySet : public BaseObject { public: + static void Initialize(Local target, + Local unused, + Local context, + void* priv); + static void New(const FunctionCallbackInfo& args); static void Enable(const FunctionCallbackInfo& args); static void Disable(const FunctionCallbackInfo& args); @@ -97,7 +102,7 @@ void GetEnabledCategories(const FunctionCallbackInfo& args) { } } -void Initialize(Local target, +void NodeCategorySet::Initialize(Local target, Local unused, Local context, void* priv) { @@ -136,4 +141,5 @@ void Initialize(Local target, } // namespace node -NODE_MODULE_CONTEXT_AWARE_INTERNAL(trace_events, node::Initialize) +NODE_MODULE_CONTEXT_AWARE_INTERNAL(trace_events, + node::NodeCategorySet::Initialize) diff --git a/src/node_types.cc b/src/node_types.cc index 97f6ef4e28c13c..048c47493d3c26 100644 --- a/src/node_types.cc +++ b/src/node_types.cc @@ -62,7 +62,8 @@ static void IsBoxedPrimitive(const FunctionCallbackInfo& args) { void InitializeTypes(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); #define V(type) env->SetMethodNoSideEffect(target, \ diff --git a/src/node_util.cc b/src/node_util.cc index 810bb1929bb6f7..4a426ddadb2a20 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -56,6 +56,7 @@ static void GetOwnNonIndexProperties( } static void GetPromiseDetails(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); // Return undefined if it's not a Promise. if (!args[0]->IsPromise()) return; @@ -74,6 +75,7 @@ static void GetPromiseDetails(const FunctionCallbackInfo& args) { } static void GetProxyDetails(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); // Return undefined if it's not a proxy. if (!args[0]->IsProxy()) return; @@ -194,7 +196,8 @@ void EnqueueMicrotask(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); #define V(name, _) \ diff --git a/src/node_v8.cc b/src/node_v8.cc index ab453134fabfc0..c61f1e6600b992 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -119,7 +119,8 @@ void SetFlagsFromString(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethodNoSideEffect(target, "cachedDataVersionTag", diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 50e80b45a42f5e..6259cbdd1918dd 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -69,7 +69,8 @@ Local PipeWrap::Instantiate(Environment* env, void PipeWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); diff --git a/src/pipe_wrap.h b/src/pipe_wrap.h index 05a5ba6e113a18..b98d850439f0f4 100644 --- a/src/pipe_wrap.h +++ b/src/pipe_wrap.h @@ -43,7 +43,8 @@ class PipeWrap : public ConnectionWrap { SocketType type); static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(PipeWrap) diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 79d661c83fc023..d0514d64e08ffc 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -49,7 +49,8 @@ class ProcessWrap : public HandleWrap { public: static void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local constructor = env->NewFunctionTemplate(New); constructor->InstanceTemplate()->SetInternalFieldCount(1); diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 613ee0926f5db1..93f86f5d790aa7 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -43,7 +43,8 @@ class SignalWrap : public HandleWrap { public: static void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local constructor = env->NewFunctionTemplate(New); constructor->InstanceTemplate()->SetInternalFieldCount(1); diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 21e2b2ffb36dc2..4aad9d8a14a7b4 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -365,7 +365,8 @@ void SyncProcessStdioPipe::CloseCallback(uv_handle_t* handle) { void SyncProcessRunner::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "spawn", Spawn); } diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 5b04d94b47b30e..53fdee11d5a7e3 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -141,7 +141,8 @@ class SyncProcessRunner { public: static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); static void Spawn(const v8::FunctionCallbackInfo& args); private: diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 0b00f225d8ad7b..931972a48c3a57 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -248,7 +248,8 @@ namespace { void InitializeStreamPipe(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); // Create FunctionTemplate for FileHandle::CloseReq diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 0435ae3ac1e906..ae54b019fea034 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -52,7 +52,8 @@ using v8::Value; void LibuvStreamWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); auto is_construct_call_callback = diff --git a/src/stream_wrap.h b/src/stream_wrap.h index 98f0ca4ac4fb67..19366ff4fba2c4 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -37,7 +37,8 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { public: static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); int GetFD() override; bool IsAlive() override; diff --git a/src/string_decoder.cc b/src/string_decoder.cc index cc38cd927a0f89..a83d6623b4b4bb 100644 --- a/src/string_decoder.cc +++ b/src/string_decoder.cc @@ -276,7 +276,8 @@ void FlushData(const FunctionCallbackInfo& args) { void InitializeStringDecoder(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 504fda3de6cf95..5adab06df456bb 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -73,7 +73,8 @@ Local TCPWrap::Instantiate(Environment* env, void TCPWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index 3cbeae6d64a949..a554832841aa31 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -42,7 +42,8 @@ class TCPWrap : public ConnectionWrap { SocketType type); static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); SET_NO_MEMORY_INFO() SET_SELF_SIZE(TCPWrap) diff --git a/src/timers.cc b/src/timers.cc index e9daf8d37cae92..f0ee1db4152501 100644 --- a/src/timers.cc +++ b/src/timers.cc @@ -43,7 +43,8 @@ void ToggleImmediateRef(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "getLibuvNow", GetLibuvNow); diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 52d4e7381318bc..3995c16d95d5a0 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -871,7 +871,8 @@ void TLSWrap::MemoryInfo(MemoryTracker* tracker) const { void TLSWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "wrap", TLSWrap::Wrap); diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 4c47cd81197189..13f2bc1c719e35 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -54,7 +54,8 @@ class TLSWrap : public AsyncWrap, static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); int GetFD() override; bool IsAlive() override; diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index 2523f57b2d4aab..dc9dc3514238bc 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -43,7 +43,8 @@ using v8::Value; void TTYWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local ttyString = FIXED_ONE_BYTE_STRING(env->isolate(), "TTY"); diff --git a/src/tty_wrap.h b/src/tty_wrap.h index f794e2112fa1ee..63a340fd8d5388 100644 --- a/src/tty_wrap.h +++ b/src/tty_wrap.h @@ -34,7 +34,8 @@ class TTYWrap : public LibuvStreamWrap { public: static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(TTYWrap) diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index b4c859e5947b80..2e076e26b9fbed 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -88,7 +88,8 @@ UDPWrap::UDPWrap(Environment* env, Local object) void UDPWrap::Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); diff --git a/src/udp_wrap.h b/src/udp_wrap.h index e6b575f74a0ec9..6347cdea87b450 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -39,7 +39,8 @@ class UDPWrap: public HandleWrap { }; static void Initialize(v8::Local target, v8::Local unused, - v8::Local context); + v8::Local context, + void* priv); static void GetFD(const v8::FunctionCallbackInfo& args); static void New(const v8::FunctionCallbackInfo& args); static void Open(const v8::FunctionCallbackInfo& args); diff --git a/src/uv.cc b/src/uv.cc index 5405b2058a15d2..79c221f4dfafcb 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -60,7 +60,8 @@ void ErrName(const FunctionCallbackInfo& args) { void Initialize(Local target, Local unused, - Local context) { + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); target->Set(env->context(),