GeezerVison is showing github.com — lib: enable global CustomEvent by default · nodejs/node@8027099
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -341,16 +341,6 @@ when `Error.stack` is accessed. If you access `Error.stack` frequently | 341 | 341 | in your application, take into account the performance implications | 342 | 342 | of `--enable-source-maps`. | 343 | 343 |
| 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 | | - | 354 | 344 | ### `--experimental-import-meta-resolve` | 355 | 345 |
| 356 | 346 | <!-- YAML | @@ -411,6 +401,14 @@ added: REPLACEME | 411 | 401 |
| 412 | 402 | Disable exposition of [Web Crypto API][] on the global scope. | 413 | 403 |
| | 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 | + | 414 | 412 | ### `--no-experimental-repl-await` | 415 | 413 |
| 416 | 414 | <!-- YAML | @@ -1829,7 +1827,6 @@ Node.js options that are allowed are: | 1829 | 1827 | * `--enable-fips` | 1830 | 1828 | * `--enable-source-maps` | 1831 | 1829 | * `--experimental-abortcontroller` | 1832 | | -* `--experimental-global-customevent` | 1833 | 1830 | * `--experimental-import-meta-resolve` | 1834 | 1831 | * `--experimental-json-modules` | 1835 | 1832 | * `--experimental-loader` | @@ -1862,6 +1859,7 @@ Node.js options that are allowed are: | 1862 | 1859 | * `--no-addons` | 1863 | 1860 | * `--no-deprecation` | 1864 | 1861 | * `--no-experimental-fetch` | | 1862 | +* `--no-experimental-global-customevent` | 1865 | 1863 | * `--no-experimental-global-webcrypto` | 1866 | 1864 | * `--no-experimental-repl-await` | 1867 | 1865 | * `--no-extra-info-on-fatal-exception` | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -400,10 +400,14 @@ only if the Node.js binary was compiled with including support for the | 400 | 400 | added: | 401 | 401 | - v18.7.0 | 402 | 402 | - 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. | 403 | 407 | --> | 404 | 408 |
| 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. | 407 | 411 |
| 408 | 412 | <!-- type=global --> | 409 | 413 |
| @@ -947,8 +951,8 @@ added: v18.0.0 | 947 | 951 | A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. | 948 | 952 |
| 949 | 953 | [Web Crypto API]: webcrypto.md | 950 | | -[`--experimental-global-customevent`]: cli.md#--experimental-global-customevent | 951 | 954 | [`--no-experimental-fetch`]: cli.md#--no-experimental-fetch | | 955 | +[`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent | 952 | 956 | [`--no-experimental-global-webcrypto`]: cli.md#--no-experimental-global-webcrypto | 953 | 957 | [`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController | 954 | 958 | [`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy | |
Collapse file Copy file name to clipboardExpand all lines: doc/node.1 +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -139,9 +139,6 @@ Requires Node.js to be built with | 139 | 139 | .It Fl -enable-source-maps | 140 | 140 | Enable Source Map V3 support for stack traces. | 141 | 141 | . | 142 | | -.It Fl -experimental-global-customevent | 143 | | -Expose the CustomEvent on the global scope. | 144 | | -. | 145 | 142 | .It Fl -experimental-global-webcrypto | 146 | 143 | Expose the Web Crypto API on the global scope. | 147 | 144 | . | @@ -165,6 +162,9 @@ Use this flag to enable ShadowRealm support. | 165 | 162 | .It Fl -no-experimental-fetch | 166 | 163 | Disable experimental support for the Fetch API. | 167 | 164 | . | | 165 | +.It Fl -no-experimental-global-customevent | | 166 | +Disable exposition of the CustomEvent on the global scope. | | 167 | +. | 168 | 168 | .It Fl -no-experimental-global-webcrypto | 169 | 169 | Disable exposition of the Web Crypto API on the global scope. | 170 | 170 | . | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/process/pre_execution.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -278,7 +278,7 @@ function setupWebCrypto() { | 278 | 278 | // removed. | 279 | 279 | function setupCustomEvent() { | 280 | 280 | if (process.config.variables.node_no_browser_globals || | 281 | | - !getOptionValue('--experimental-global-customevent')) { | | 281 | + getOptionValue('--no-experimental-global-customevent')) { | 282 | 282 | return; | 283 | 283 | } | 284 | 284 | const { CustomEvent } = require('internal/event_target'); | |
Collapse file Copy file name to clipboardExpand all lines: src/node_options.cc +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -358,7 +358,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | 358 | 358 | AddOption("--experimental-global-customevent", | 359 | 359 | "expose experimental CustomEvent on the global scope", | 360 | 360 | &EnvironmentOptions::experimental_global_customevent, | 361 | | - kAllowedInEnvironment); | | 361 | + kAllowedInEnvironment, | | 362 | + true); | 362 | 363 | AddOption("--experimental-global-webcrypto", | 363 | 364 | "expose experimental Web Crypto API on the global scope", | 364 | 365 | &EnvironmentOptions::experimental_global_web_crypto, | |
Collapse file Copy file name to clipboardExpand all lines: src/node_options.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -109,7 +109,7 @@ class EnvironmentOptions : public Options { | 109 | 109 | std::string dns_result_order; | 110 | 110 | bool enable_source_maps = false; | 111 | 111 | bool experimental_fetch = true; | 112 | | - bool experimental_global_customevent = false; | | 112 | + bool experimental_global_customevent = true; | 113 | 113 | bool experimental_global_web_crypto = true; | 114 | 114 | bool experimental_https_modules = false; | 115 | 115 | bool experimental_wasm_modules = false; | |
Collapse file Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 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 Copy file name to clipboardExpand all lines: test/parallel/test-global-customevent.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -// Flags: --experimental-global-customevent --expose-internals | | 1 | +// Flags: --expose-internals | 2 | 2 | 'use strict'; | 3 | 3 |
| 4 | 4 | require('../common'); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-repl-tab-complete.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -405,7 +405,7 @@ putIn.run([ | 405 | 405 | 'var custom = "test";', | 406 | 406 | ]); | 407 | 407 | testMe.complete('cus', common.mustCall(function(error, data) { | 408 | | - assert.deepStrictEqual(data, [['custom'], 'cus']); | | 408 | + assert.deepStrictEqual(data, [['CustomEvent', 'custom'], 'cus']); | 409 | 409 | })); | 410 | 410 |
| 411 | 411 | // Make sure tab completion doesn't crash REPL with half-baked proxy objects. | |
Collapse file Copy file name to clipboardExpand all lines: test/wpt/test-events.js -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,4 @@ const { WPTRunner } = require('../common/wpt'); | 4 | 4 |
| 5 | 5 | const runner = new WPTRunner('dom/events'); | 6 | 6 |
| 7 | | -runner.setFlags(['--experimental-global-customevent']); | 8 | | - | 9 | 7 | runner.runJsTests(); |
|