Skip to content

Commit a8b26d7

Browse files
committed
lib: unflag AbortController
It's still experimental, but make the flag non-op Signed-off-by: James M Snell <[email protected]> PR-URL: #33527 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 74ca960 commit a8b26d7

File tree

9 files changed

+16
-41
lines changed

9 files changed

+16
-41
lines changed

‎doc/api/cli.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,14 @@ Currently, overriding `Error.prepareStackTrace` is ignored when the
170170
### `--experimental-abortcontroller`
171171
<!-- YAML
172172
added: REPLACEME
173+
changes:
174+
- version: REPLACEME
175+
pr-url: https://github.com/nodejs/node/pull/33527
176+
description: --experimental-abortcontroller is no longer required.
173177
-->
174178

175-
Enable experimental `AbortController` and `AbortSignal` support.
179+
Experimental `AbortController` and `AbortSignal` support is enabled by default.
180+
Use of this command line flag is no longer required.
176181

177182
### `--experimental-import-meta-resolve`
178183
<!-- YAML

‎doc/api/globals.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ added: REPLACEME
2929
A utility class used to signal cancelation in selected `Promise`-based APIs.
3030
The API is based on the Web API [`AbortController`][].
3131

32-
To use, launch Node.js using the `--experimental-abortcontroller` flag.
33-
3432
```js
3533
constac=newAbortController();
3634

‎doc/node.1‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ Enable FIPS-compliant crypto at startup.
118118
Requires Node.js to be built with
119119
.Sy./configure--openssl-fips .
120120
.
121-
.ItFl-experimental-abortcontroller
122-
Enable experimental AbortController and AbortSignal support.
123-
.
124121
.ItFl-enable-source-maps
125122
Enable experimental Source Map V3 support for stack traces.
126123
.

‎lib/internal/bootstrap/node.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ if (!config.noBrowserGlobals){
133133
// https://encoding.spec.whatwg.org/#textdecoder
134134
exposeInterface(global,'TextDecoder',TextDecoder);
135135

136+
const{
137+
AbortController,
138+
AbortSignal,
139+
}=require('internal/abort_controller');
140+
exposeInterface(global,'AbortController',AbortController);
141+
exposeInterface(global,'AbortSignal',AbortSignal);
142+
136143
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
137144
consttimers=require('timers');
138145
defineOperation(global,'clearInterval',timers.clearInterval);

‎lib/internal/bootstrap/pre_execution.js‎

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const{
44
Map,
55
ObjectDefineProperty,
6-
ObjectDefineProperties,
76
SafeWeakMap,
87
}=primordials;
98

@@ -54,7 +53,6 @@ function prepareMainThreadExecution(expandArgv1 = false){
5453
// (including preload modules).
5554
initializeClusterIPC();
5655

57-
initializeAbortController();
5856
initializeDeprecations();
5957
initializeWASI();
6058
initializeCJSLoader();
@@ -306,30 +304,6 @@ function initializeDeprecations(){
306304
});
307305
}
308306

309-
functioninitializeAbortController(){
310-
constabortController=getOptionValue('--experimental-abortcontroller');
311-
if(abortController){
312-
const{
313-
AbortController,
314-
AbortSignal
315-
}=require('internal/abort_controller');
316-
ObjectDefineProperties(global,{
317-
AbortController: {
318-
writable: true,
319-
enumerable: false,
320-
configurable: true,
321-
value: AbortController
322-
},
323-
AbortSignal: {
324-
writable: true,
325-
enumerable: false,
326-
configurable: true,
327-
value: AbortSignal
328-
}
329-
});
330-
}
331-
}
332-
333307
functionsetupChildProcessIpcChannel(){
334308
if(process.env.NODE_CHANNEL_FD){
335309
constassert=require('internal/assert');
@@ -464,7 +438,6 @@ module.exports ={
464438
setupWarningHandler,
465439
setupDebugEnv,
466440
prepareMainThreadExecution,
467-
initializeAbortController,
468441
initializeDeprecations,
469442
initializeESMLoader,
470443
initializeFrozenIntrinsics,

‎lib/internal/main/worker_thread.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const{
1313
setupInspectorHooks,
1414
setupWarningHandler,
1515
setupDebugEnv,
16-
initializeAbortController,
1716
initializeDeprecations,
1817
initializeWASI,
1918
initializeCJSLoader,
@@ -113,7 +112,6 @@ port.on('message', (message) =>{
113112
if(manifestSrc){
114113
require('internal/process/policy').setup(manifestSrc,manifestURL);
115114
}
116-
initializeAbortController();
117115
initializeDeprecations();
118116
initializeWASI();
119117
initializeCJSLoader();

‎src/node_options.cc‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser(){
274274
"experimental Source Map V3 support",
275275
&EnvironmentOptions::enable_source_maps,
276276
kAllowedInEnvironment);
277-
AddOption("--experimental-abortcontroller",
278-
"experimental AbortController support",
279-
&EnvironmentOptions::experimental_abortcontroller,
280-
kAllowedInEnvironment);
277+
AddOption("--experimental-abortcontroller", "",
278+
NoOp{}, kAllowedInEnvironment);
281279
AddOption("--experimental-json-modules",
282280
"experimental JSON interop support for the ES Module loader",
283281
&EnvironmentOptions::experimental_json_modules,

‎src/node_options.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class EnvironmentOptions : public Options{
101101
public:
102102
bool abort_on_uncaught_exception = false;
103103
bool enable_source_maps = false;
104-
bool experimental_abortcontroller = false;
105104
bool experimental_json_modules = false;
106105
bool experimental_modules = false;
107106
std::string experimental_specifier_resolution;

‎test/parallel/test-abortcontroller.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --no-warnings --experimental-abortcontroller
1+
// Flags: --no-warnings
22
'use strict';
33

44
constcommon=require('../common');

0 commit comments

Comments
(0)