GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: enable global CustomEvent by default · nodejs/node@8027099

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc
    • api
      • cli.md
      • globals.md
    • node.1
  • lib/internal/process
    • pre_execution.js
  • src
    • node_options.cc
    • node_options.h
  • test
    • parallel
      • test-global-customevent-disabled.js
      • test-global-customevent.js
      • test-repl-tab-complete.js
    • wpt
      • test-events.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/cli.md‎

Copy file name to clipboardExpand all lines: doc/api/cli.md
+9-11Lines changed: 9 additions & 11 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,6 @@ when `Error.stack` is accessed. If you access `Error.stack` frequently
341341
in your application, take into account the performance implications
342342
of `--enable-source-maps`.
343343

344-
### `--experimental-global-customevent`
345-
346-
<!-- YAML
347-
added:
348-
- v18.7.0
349-
- v16.17.0
350-
-->
351-
352-
Expose the [CustomEvent Web API][] on the global scope.
353-
354344
### `--experimental-import-meta-resolve`
355345

356346
<!-- YAML
@@ -411,6 +401,14 @@ added: REPLACEME
411401

412402
Disable exposition of [Web Crypto API][] on the global scope.
413403

404+
### `--no-experimental-global-customevent`
405+
406+
<!-- YAML
407+
added: REPLACEME
408+
-->
409+
410+
Disable exposition of [CustomEvent Web API][] on the global scope.
411+
414412
### `--no-experimental-repl-await`
415413

416414
<!-- YAML
@@ -1829,7 +1827,6 @@ Node.js options that are allowed are:
18291827
* `--enable-fips`
18301828
* `--enable-source-maps`
18311829
* `--experimental-abortcontroller`
1832-
* `--experimental-global-customevent`
18331830
* `--experimental-import-meta-resolve`
18341831
* `--experimental-json-modules`
18351832
* `--experimental-loader`
@@ -1862,6 +1859,7 @@ Node.js options that are allowed are:
18621859
* `--no-addons`
18631860
* `--no-deprecation`
18641861
* `--no-experimental-fetch`
1862+
* `--no-experimental-global-customevent`
18651863
* `--no-experimental-global-webcrypto`
18661864
* `--no-experimental-repl-await`
18671865
* `--no-extra-info-on-fatal-exception`
Collapse file

‎doc/api/globals.md‎

Copy file name to clipboardExpand all lines: doc/api/globals.md
+7-3Lines changed: 7 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,14 @@ only if the Node.js binary was compiled with including support for the
400400
added:
401401
- v18.7.0
402402
- v16.17.0
403+
changes:
404+
- version: REPLACEME
405+
pr-url: https://github.com/nodejs/node/pull/44860
406+
description: No longer behind `--experimental-global-customevent` CLI flag.
403407
-->
404408

405-
> Stability: 1 - Experimental. Enable this API with the
406-
> [`--experimental-global-customevent`][] CLI flag.
409+
> Stability: 1 - Experimental. Disable this API with the
410+
> [`--no-experimental-global-customevent`][] CLI flag.
407411
408412
<!-- type=global -->
409413

@@ -947,8 +951,8 @@ added: v18.0.0
947951
A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
948952

949953
[Web Crypto API]: webcrypto.md
950-
[`--experimental-global-customevent`]: cli.md#--experimental-global-customevent
951954
[`--no-experimental-fetch`]: cli.md#--no-experimental-fetch
955+
[`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent
952956
[`--no-experimental-global-webcrypto`]: cli.md#--no-experimental-global-webcrypto
953957
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
954958
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
Collapse file

‎doc/node.1‎

Copy file name to clipboardExpand all lines: doc/node.1
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ Requires Node.js to be built with
139139
.It Fl -enable-source-maps
140140
Enable Source Map V3 support for stack traces.
141141
.
142-
.It Fl -experimental-global-customevent
143-
Expose the CustomEvent on the global scope.
144-
.
145142
.It Fl -experimental-global-webcrypto
146143
Expose the Web Crypto API on the global scope.
147144
.
@@ -165,6 +162,9 @@ Use this flag to enable ShadowRealm support.
165162
.It Fl -no-experimental-fetch
166163
Disable experimental support for the Fetch API.
167164
.
165+
.It Fl -no-experimental-global-customevent
166+
Disable exposition of the CustomEvent on the global scope.
167+
.
168168
.It Fl -no-experimental-global-webcrypto
169169
Disable exposition of the Web Crypto API on the global scope.
170170
.
Collapse file

‎lib/internal/process/pre_execution.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/pre_execution.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function setupWebCrypto() {
278278
// removed.
279279
function setupCustomEvent() {
280280
if (process.config.variables.node_no_browser_globals ||
281-
!getOptionValue('--experimental-global-customevent')) {
281+
getOptionValue('--no-experimental-global-customevent')) {
282282
return;
283283
}
284284
const { CustomEvent } = require('internal/event_target');
Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
358358
AddOption("--experimental-global-customevent",
359359
"expose experimental CustomEvent on the global scope",
360360
&EnvironmentOptions::experimental_global_customevent,
361-
kAllowedInEnvironment);
361+
kAllowedInEnvironment,
362+
true);
362363
AddOption("--experimental-global-webcrypto",
363364
"expose experimental Web Crypto API on the global scope",
364365
&EnvironmentOptions::experimental_global_web_crypto,
Collapse file

‎src/node_options.h‎

Copy file name to clipboardExpand all lines: src/node_options.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class EnvironmentOptions : public Options {
109109
std::string dns_result_order;
110110
bool enable_source_maps = false;
111111
bool experimental_fetch = true;
112-
bool experimental_global_customevent = false;
112+
bool experimental_global_customevent = true;
113113
bool experimental_global_web_crypto = true;
114114
bool experimental_https_modules = false;
115115
bool experimental_wasm_modules = false;
Collapse file

‎test/parallel/test-global-customevent-disabled.js‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Flags: --no-experimental-global-customevent
2+
'use strict';
3+
4+
require('../common');
5+
const { strictEqual } = require('node:assert');
6+
7+
strictEqual(typeof CustomEvent, 'undefined');
Collapse file

‎test/parallel/test-global-customevent.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-global-customevent.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --experimental-global-customevent --expose-internals
1+
// Flags: --expose-internals
22
'use strict';
33

44
require('../common');
Collapse file

‎test/parallel/test-repl-tab-complete.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-tab-complete.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ putIn.run([
405405
'var custom = "test";',
406406
]);
407407
testMe.complete('cus', common.mustCall(function(error, data) {
408-
assert.deepStrictEqual(data, [['custom'], 'cus']);
408+
assert.deepStrictEqual(data, [['CustomEvent', 'custom'], 'cus']);
409409
}));
410410

411411
// Make sure tab completion doesn't crash REPL with half-baked proxy objects.
Collapse file

‎test/wpt/test-events.js‎

Copy file name to clipboardExpand all lines: test/wpt/test-events.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ const { WPTRunner } = require('../common/wpt');
44

55
const runner = new WPTRunner('dom/events');
66

7-
runner.setFlags(['--experimental-global-customevent']);
8-
97
runner.runJsTests();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.