Skip to content

Commit 5f37dec

Browse files
joyeecheungtargos
authored andcommitted
bootstrap: include event_target into the built-in snapshot
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]>
1 parent c3f56a3 commit 5f37dec

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/internal/bootstrap/browser.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ defineOperation(globalThis, 'setTimeout', timers.setTimeout);
4242
exposeLazyInterfaces(globalThis, 'internal/abort_controller', [
4343
'AbortController', 'AbortSignal',
4444
]);
45-
exposeLazyInterfaces(globalThis, 'internal/event_target', [
46-
'EventTarget', 'Event',
47-
]);
45+
const {
46+
EventTarget, Event,
47+
} = require('internal/event_target');
48+
exposeInterface(globalThis, 'Event', Event);
49+
exposeInterface(globalThis, 'EventTarget', EventTarget);
4850
exposeLazyInterfaces(globalThis, 'internal/worker/io', [
4951
'MessageChannel', 'MessagePort', 'MessageEvent',
5052
]);

test/parallel/test-bootstrap-modules.js

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const expectedModules = new Set([
4646
'NativeModule internal/constants',
4747
'NativeModule internal/dns/utils',
4848
'NativeModule internal/errors',
49+
'NativeModule internal/event_target',
4950
'NativeModule internal/fixed_queue',
5051
'NativeModule internal/fs/utils',
5152
'NativeModule internal/idna',
@@ -90,6 +91,7 @@ const expectedModules = new Set([
9091
'NativeModule internal/vm',
9192
'NativeModule internal/vm/module',
9293
'NativeModule internal/wasm_web_api',
94+
'NativeModule internal/webidl',
9395
'NativeModule internal/worker/js_transferable',
9496
'Internal Binding blob',
9597
'NativeModule async_hooks',
@@ -99,6 +101,7 @@ const expectedModules = new Set([
99101
'NativeModule url',
100102
'NativeModule internal/v8/startup_snapshot',
101103
'NativeModule vm',
104+
'NativeModule util',
102105
]);
103106

104107
if (!common.isMainThread) {

0 commit comments

Comments
 (0)