diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-10-04 14:11:36 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2020-10-11 17:35:17 +0300 |
commit | eee522ac29864a55a8bc6686e6b38e93270aa1ca (patch) | |
tree | 3e7ac32cf16d758f1f7480fcb7ef47070c005391 /src/node_worker.cc | |
parent | 705d888387f7a58c10711acbe5a4661c496969ad (diff) |
lib: add EventTarget-related browser globals
Add
- Event
- EventTarget
- MessagePort
- MessageChannel
- MessageEvent
to the set of global objects, since they are available now and behave
like they do in the browser.
Fixes: https://github.com/nodejs/node/issues/35495
PR-URL: https://github.com/nodejs/node/pull/35496
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r-- | src/node_worker.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index 4159a6efeda..cdaeefb7897 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -2,6 +2,7 @@ #include "debug_utils-inl.h" #include "memory_tracker-inl.h" #include "node_errors.h" +#include "node_external_reference.h" #include "node_buffer.h" #include "node_options-inl.h" #include "node_perf.h" @@ -860,9 +861,20 @@ void InitWorker(Local<Object> target, NODE_DEFINE_CONSTANT(target, kTotalResourceLimitCount); } -} // anonymous namespace +void RegisterExternalReferences(ExternalReferenceRegistry* registry) { + registry->Register(GetEnvMessagePort); + registry->Register(Worker::New); + registry->Register(Worker::StartThread); + registry->Register(Worker::StopThread); + registry->Register(Worker::Ref); + registry->Register(Worker::Unref); + registry->Register(Worker::GetResourceLimits); + registry->Register(Worker::TakeHeapSnapshot); +} +} // anonymous namespace } // namespace worker } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(worker, node::worker::InitWorker) +NODE_MODULE_EXTERNAL_REFERENCE(worker, node::worker::RegisterExternalReferences) |