| 
21 | 21 | 
 
  | 
22 | 22 | #include "node_contextify.h"  | 
23 | 23 | 
 
  | 
24 |  | -#include "memory_tracker-inl.h"  | 
25 |  | -#include "node_internals.h"  | 
26 |  | -#include "node_watchdog.h"  | 
27 | 24 | #include "base_object-inl.h"  | 
 | 25 | +#include "memory_tracker-inl.h"  | 
 | 26 | +#include "module_wrap.h"  | 
28 | 27 | #include "node_context_data.h"  | 
29 | 28 | #include "node_errors.h"  | 
30 |  | -#include "module_wrap.h"  | 
 | 29 | +#include "node_external_reference.h"  | 
 | 30 | +#include "node_internals.h"  | 
 | 31 | +#include "node_watchdog.h"  | 
31 | 32 | #include "util-inl.h"  | 
32 | 33 | 
 
  | 
33 | 34 | namespace node {  | 
@@ -255,6 +256,12 @@ void ContextifyContext::Init(Environment* env, Local<Object> target) {  | 
255 | 256 |   env->SetMethod(target, "compileFunction", CompileFunction);  | 
256 | 257 | }  | 
257 | 258 | 
 
  | 
 | 259 | +void ContextifyContext::RegisterExternalReferences(  | 
 | 260 | +    ExternalReferenceRegistry* registry) {  | 
 | 261 | +  registry->Register(MakeContext);  | 
 | 262 | +  registry->Register(IsContext);  | 
 | 263 | +  registry->Register(CompileFunction);  | 
 | 264 | +}  | 
258 | 265 | 
 
  | 
259 | 266 | // makeContext(sandbox, name, origin, strings, wasm);  | 
260 | 267 | void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) {  | 
@@ -665,6 +672,14 @@ void ContextifyScript::Init(Environment* env, Local<Object> target) {  | 
665 | 672 |   env->set_script_context_constructor_template(script_tmpl);  | 
666 | 673 | }  | 
667 | 674 | 
 
  | 
 | 675 | +void ContextifyScript::RegisterExternalReferences(  | 
 | 676 | +    ExternalReferenceRegistry* registry) {  | 
 | 677 | +  registry->Register(New);  | 
 | 678 | +  registry->Register(CreateCachedData);  | 
 | 679 | +  registry->Register(RunInContext);  | 
 | 680 | +  registry->Register(RunInThisContext);  | 
 | 681 | +}  | 
 | 682 | + | 
668 | 683 | void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {  | 
669 | 684 |   Environment* env = Environment::GetCurrent(args);  | 
670 | 685 |   Isolate* isolate = env->isolate();  | 
@@ -1293,6 +1308,10 @@ void MicrotaskQueueWrap::Init(Environment* env, Local<Object> target) {  | 
1293 | 1308 |   env->SetConstructorFunction(target, "MicrotaskQueue", tmpl);  | 
1294 | 1309 | }  | 
1295 | 1310 | 
 
  | 
 | 1311 | +void MicrotaskQueueWrap::RegisterExternalReferences(  | 
 | 1312 | +    ExternalReferenceRegistry* registry) {  | 
 | 1313 | +  registry->Register(New);  | 
 | 1314 | +}  | 
1296 | 1315 | 
 
  | 
1297 | 1316 | void Initialize(Local<Object> target,  | 
1298 | 1317 |                 Local<Value> unused,  | 
@@ -1347,7 +1366,19 @@ void Initialize(Local<Object> target,  | 
1347 | 1366 |   env->SetMethod(target, "measureMemory", MeasureMemory);  | 
1348 | 1367 | }  | 
1349 | 1368 | 
 
  | 
 | 1369 | +void RegisterExternalReferences(ExternalReferenceRegistry* registry) {  | 
 | 1370 | +  ContextifyContext::RegisterExternalReferences(registry);  | 
 | 1371 | +  ContextifyScript::RegisterExternalReferences(registry);  | 
 | 1372 | +  MicrotaskQueueWrap::RegisterExternalReferences(registry);  | 
 | 1373 | + | 
 | 1374 | +  registry->Register(StartSigintWatchdog);  | 
 | 1375 | +  registry->Register(StopSigintWatchdog);  | 
 | 1376 | +  registry->Register(WatchdogHasPendingSigint);  | 
 | 1377 | +  registry->Register(MeasureMemory);  | 
 | 1378 | +}  | 
1350 | 1379 | }  // namespace contextify  | 
1351 | 1380 | }  // namespace node  | 
1352 | 1381 | 
 
  | 
1353 | 1382 | NODE_MODULE_CONTEXT_AWARE_INTERNAL(contextify, node::contextify::Initialize)  | 
 | 1383 | +NODE_MODULE_EXTERNAL_REFERENCE(contextify,  | 
 | 1384 | +                               node::contextify::RegisterExternalReferences)  | 
0 commit comments