Skip to content

Commit

Permalink
cli: remove --no-experimental-global-customevent flag
Browse files Browse the repository at this point in the history
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
  • Loading branch information
daeyeon committed Apr 27, 2024
1 parent 40ef9d5 commit 0dcdf70
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 37 deletions.
9 changes: 0 additions & 9 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,14 +1364,6 @@ added: v0.8.0

Silence deprecation warnings.

### `--no-experimental-global-customevent`

<!-- YAML
added: v19.0.0
-->

Disable exposition of [CustomEvent Web API][] on the global scope.

### `--no-experimental-global-navigator`

<!-- YAML
Expand Down Expand Up @@ -2682,7 +2674,6 @@ one is included in the list below.
* `--network-family-autoselection-attempt-timeout`
* `--no-addons`
* `--no-deprecation`
* `--no-experimental-global-customevent`
* `--no-experimental-global-navigator`
* `--no-experimental-repl-await`
* `--no-experimental-websocket`
Expand Down
3 changes: 0 additions & 3 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ Enable code coverage in the test runner.
.It Fl -no-experimental-websocket
Disable experimental support for the WebSocket API.
.
.It Fl -no-experimental-global-customevent
Disable exposition of the CustomEvent on the global scope.
.
.It Fl -no-experimental-repl-await
Disable top-level await keyword support in REPL.
.
Expand Down
1 change: 1 addition & 0 deletions lib/internal/bootstrap/web/exposed-wildcard.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const {
} = require('internal/event_target');
exposeInterface(globalThis, 'Event', Event);
exposeInterface(globalThis, 'EventTarget', EventTarget);
exposeLazyInterfaces(globalThis, 'internal/event_target', ['CustomEvent']);

// https://encoding.spec.whatwg.org/#textencoder
// https://encoding.spec.whatwg.org/#textdecoder
Expand Down
12 changes: 0 additions & 12 deletions lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ function prepareExecution(options) {
setupNavigator();
setupWarningHandler();
setupWebsocket();
setupCustomEvent();
setupCodeCoverage();
setupDebugEnv();
// Process initial diagnostic reporting configuration, if present.
Expand Down Expand Up @@ -341,17 +340,6 @@ function setupCodeCoverage() {
}
}

// TODO(daeyeon): move this to internal/bootstrap/web/* when the CLI flag is
// removed.
function setupCustomEvent() {
if (getEmbedderOptions().noBrowserGlobals ||
getOptionValue('--no-experimental-global-customevent')) {
return;
}
const { CustomEvent } = require('internal/event_target');
exposeInterface(globalThis, 'CustomEvent', CustomEvent);
}

function setupStacktracePrinterOnSigint() {
if (!getOptionValue('--trace-sigint')) {
return;
Expand Down
6 changes: 1 addition & 5 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
&EnvironmentOptions::experimental_websocket,
kAllowedInEnvvar,
true);
AddOption("--experimental-global-customevent",
"expose experimental CustomEvent on the global scope",
&EnvironmentOptions::experimental_global_customevent,
kAllowedInEnvvar,
true);
AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-global-navigator",
"expose experimental Navigator API on the global scope",
&EnvironmentOptions::experimental_global_navigator,
Expand Down
1 change: 0 additions & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class EnvironmentOptions : public Options {
bool enable_source_maps = false;
bool experimental_fetch = true;
bool experimental_websocket = true;
bool experimental_global_customevent = true;
bool experimental_global_navigator = true;
bool experimental_global_web_crypto = true;
bool experimental_https_modules = false;
Expand Down
1 change: 1 addition & 0 deletions test/common/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const webIdlExposedWildcard = new Set([
'TextDecoder',
'AbortController',
'AbortSignal',
'CustomEvent',
'EventTarget',
'Event',
'URL',
Expand Down
7 changes: 0 additions & 7 deletions test/parallel/test-global-customevent-disabled.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ assert(undocumented.delete('--debug-arraybuffer-allocations'));
assert(undocumented.delete('--no-debug-arraybuffer-allocations'));
assert(undocumented.delete('--es-module-specifier-resolution'));
assert(undocumented.delete('--experimental-fetch'));
assert(undocumented.delete('--experimental-global-customevent'));
assert(undocumented.delete('--experimental-global-webcrypto'));
assert(undocumented.delete('--experimental-report'));
assert(undocumented.delete('--experimental-worker'));
Expand Down

0 comments on commit 0dcdf70

Please sign in to comment.