Skip to content

Commit

Permalink
bootstrap: include event_target into the built-in snapshot
Browse files Browse the repository at this point in the history
Since the module has to be loaded during bootstrap anyway.

PR-URL: nodejs/node#45849
Backport-PR-URL: nodejs/node#46425
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
  • Loading branch information
sercher committed Apr 24, 2024
1 parent 3b3befe commit 4a03486
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions graal-nodejs/lib/internal/bootstrap/browser.js
Expand Up @@ -42,9 +42,11 @@ defineOperation(globalThis, 'setTimeout', timers.setTimeout);
exposeLazyInterfaces(globalThis, 'internal/abort_controller', [
'AbortController', 'AbortSignal',
]);
exposeLazyInterfaces(globalThis, 'internal/event_target', [
'EventTarget', 'Event',
]);
const {
EventTarget, Event,
} = require('internal/event_target');
exposeInterface(globalThis, 'Event', Event);
exposeInterface(globalThis, 'EventTarget', EventTarget);
exposeLazyInterfaces(globalThis, 'internal/worker/io', [
'MessageChannel', 'MessagePort', 'MessageEvent',
]);
Expand Down
3 changes: 3 additions & 0 deletions graal-nodejs/test/parallel/test-bootstrap-modules.js
Expand Up @@ -46,6 +46,7 @@ const expectedModules = new Set([
'NativeModule internal/constants',
'NativeModule internal/dns/utils',
'NativeModule internal/errors',
'NativeModule internal/event_target',
'NativeModule internal/fixed_queue',
'NativeModule internal/fs/utils',
'NativeModule internal/graal/buffer',
Expand Down Expand Up @@ -91,6 +92,7 @@ const expectedModules = new Set([
'NativeModule internal/vm',
'NativeModule internal/vm/module',
'NativeModule internal/wasm_web_api',
'NativeModule internal/webidl',
'NativeModule internal/worker/js_transferable',
'Internal Binding blob',
'NativeModule async_hooks',
Expand All @@ -100,6 +102,7 @@ const expectedModules = new Set([
'NativeModule url',
'NativeModule internal/v8/startup_snapshot',
'NativeModule vm',
'NativeModule util',
]);

if (!common.isMainThread) {
Expand Down

0 comments on commit 4a03486

Please sign in to comment.