Skip to content

Commit 03225c5

Browse files
committed
repl: unflag Top-Level Await
unflags Top-Level await for the REPL. This is accomplished by getting rid of --experimental-repl-await flag and the checks related to the same.
1 parent 1f9b20b commit 03225c5

File tree

7 files changed

+7
-18
lines changed

7 files changed

+7
-18
lines changed

doc/api/cli.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,6 @@ added: v11.8.0
230230

231231
Use the specified file as a security policy.
232232

233-
### `--experimental-repl-await`
234-
<!-- YAML
235-
added: v10.0.0
236-
-->
237-
238-
Enable experimental top-level `await` keyword support in REPL.
239-
240233
### `--experimental-specifier-resolution=mode`
241234
<!-- YAML
242235
added:
@@ -1242,7 +1235,6 @@ Node.js options that are allowed are:
12421235
* `--experimental-loader`
12431236
* `--experimental-modules`
12441237
* `--experimental-policy`
1245-
* `--experimental-repl-await`
12461238
* `--experimental-specifier-resolution`
12471239
* `--experimental-top-level-await`
12481240
* `--experimental-vm-modules`

doc/api/repl.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ Error: foo
224224

225225
#### `await` keyword
226226

227-
With the [`--experimental-repl-await`][] command line option specified,
228-
experimental support for the `await` keyword is enabled.
227+
Support for the `await` keyword is enabled at the top level.
229228

230229
```console
231230
> await Promise.resolve(123)
@@ -747,7 +746,6 @@ For an example of running a REPL instance over [curl(1)][], see:
747746

748747
[ZSH]: https://en.wikipedia.org/wiki/Z_shell
749748
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
750-
[`--experimental-repl-await`]: cli.html#cli_experimental_repl_await
751749
[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.html#errors_err_domain_cannot_set_uncaught_exception_capture
752750
[`ERR_INVALID_REPL_INPUT`]: errors.html#errors_err_invalid_repl_input
753751
[`domain`]: domain.html

lib/repl.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ const {
104104
} = require('internal/errors');
105105
const { sendInspectorCommand } = require('internal/util/inspector');
106106
const { getOptionValue } = require('internal/options');
107-
const experimentalREPLAwait = getOptionValue(
108-
'--experimental-repl-await'
109-
);
107+
110108
const pendingDeprecation = getOptionValue('--pending-deprecation');
111109
const {
112110
REPL_MODE_SLOPPY,
@@ -369,7 +367,7 @@ function REPLServer(prompt,
369367
wrappedCmd = true;
370368
}
371369

372-
if (experimentalREPLAwait && code.includes('await')) {
370+
if (code.includes('await')) {
373371
if (processTopLevelAwait === undefined) {
374372
({ processTopLevelAwait } = require('internal/repl/await'));
375373
}

src/node_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
329329
Implies("--policy-integrity", "[has_policy_integrity_string]");
330330
AddOption("--experimental-repl-await",
331331
"experimental await keyword support in REPL",
332-
&EnvironmentOptions::experimental_repl_await,
332+
NoOp{},
333333
kAllowedInEnvironment);
334334
AddOption("--experimental-vm-modules",
335335
"experimental ES Module support in vm module",

test/parallel/test-process-env-allowed-flags-are-documented.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ assert(undocumented.delete('--debug-arraybuffer-allocations'));
8686
assert(undocumented.delete('--es-module-specifier-resolution'));
8787
assert(undocumented.delete('--experimental-report'));
8888
assert(undocumented.delete('--experimental-worker'));
89+
assert(undocumented.delete('--experimental-repl-await'));
8990
assert(undocumented.delete('--no-node-snapshot'));
9091
assert(undocumented.delete('--loader'));
9192

test/parallel/test-repl-import-referrer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert');
44
const cp = require('child_process');
55
const fixtures = require('../common/fixtures');
66

7-
const args = ['--interactive', '--experimental-repl-await'];
7+
const args = ['--interactive'];
88
const opts = { cwd: fixtures.path('es-modules') };
99
const child = cp.spawn(process.execPath, args, opts);
1010

test/parallel/test-repl-top-level-await.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const repl = require('repl');
88

99
common.skipIfInspectorDisabled();
1010

11-
// Flags: --expose-internals --experimental-repl-await
11+
// Flags: --expose-internals
1212

1313
const PROMPT = 'await repl > ';
1414

0 commit comments

Comments
 (0)