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: #45849
Backport-PR-URL: #46425
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
  • Loading branch information
joyeecheung authored and targos committed Nov 10, 2023
1 parent c3f56a3 commit 5f37dec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/internal/bootstrap/browser.js
Original file line number Diff line number Diff line change
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 test/parallel/test-bootstrap-modules.js
Original file line number Diff line number Diff line change
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/idna',
Expand Down Expand Up @@ -90,6 +91,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 @@ -99,6 +101,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 5f37dec

Please sign in to comment.