Skip to content

Commit a9d6eb4

Browse files
authored
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 394fdec commit a9d6eb4

File tree

9 files changed

+6
-24
lines changed

9 files changed

+6
-24
lines changed

doc/api/cli.md

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

280280
Use the specified file as a security policy.
281281

282-
### `--experimental-repl-await`
283-
<!-- YAML
284-
added: v10.0.0
285-
-->
286-
287-
Enable experimental top-level `await` keyword support in REPL.
288-
289282
### `--experimental-specifier-resolution=mode`
290283
<!-- YAML
291284
added:
@@ -1401,7 +1394,6 @@ Node.js options that are allowed are:
14011394
* `--experimental-loader`
14021395
* `--experimental-modules`
14031396
* `--experimental-policy`
1404-
* `--experimental-repl-await`
14051397
* `--experimental-specifier-resolution`
14061398
* `--experimental-top-level-await`
14071399
* `--experimental-vm-modules`

doc/api/repl.md

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

218218
#### `await` keyword
219219

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

223222
```console
224223
> await Promise.resolve(123)
@@ -764,7 +763,6 @@ For an example of running a REPL instance over [`curl(1)`][], see:
764763
[TTY keybindings]: readline.md#readline_tty_keybindings
765764
[ZSH]: https://en.wikipedia.org/wiki/Z_shell
766765
[`'uncaughtException'`]: process.md#process_event_uncaughtexception
767-
[`--experimental-repl-await`]: cli.md#cli_experimental_repl_await
768766
[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.md#errors_err_domain_cannot_set_uncaught_exception_capture
769767
[`ERR_INVALID_REPL_INPUT`]: errors.md#errors_err_invalid_repl_input
770768
[`curl(1)`]: https://curl.haxx.se/docs/manpage.html

doc/node.1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,6 @@ to use as a custom module loader.
153153
.It Fl -experimental-policy
154154
Use the specified file as a security policy.
155155
.
156-
.It Fl -experimental-repl-await
157-
Enable experimental top-level
158-
.Sy await
159-
keyword support in REPL.
160-
.
161156
.It Fl -experimental-specifier-resolution
162157
Select extension resolution algorithm for ES Modules; either 'explicit' (default) or 'node'.
163158
.

lib/repl.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ const {
149149
validateObject,
150150
} = require('internal/validators');
151151

152-
const experimentalREPLAwait = getOptionValue(
153-
'--experimental-repl-await'
154-
);
155152
const pendingDeprecation = getOptionValue('--pending-deprecation');
156153
const {
157154
REPL_MODE_SLOPPY,
@@ -421,7 +418,7 @@ function REPLServer(prompt,
421418
wrappedCmd = true;
422419
}
423420

424-
if (experimentalREPLAwait && StringPrototypeIncludes(code, 'await')) {
421+
if (StringPrototypeIncludes(code, 'await')) {
425422
if (processTopLevelAwait === undefined) {
426423
({ processTopLevelAwait } = require('internal/repl/await'));
427424
}

src/node_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
348348
Implies("--policy-integrity", "[has_policy_integrity_string]");
349349
AddOption("--experimental-repl-await",
350350
"experimental await keyword support in REPL",
351-
&EnvironmentOptions::experimental_repl_await,
351+
NoOp{},
352352
kAllowedInEnvironment);
353353
AddOption("--experimental-vm-modules",
354354
"experimental ES Module support in vm module",

src/node_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class EnvironmentOptions : public Options {
112112
std::string experimental_policy;
113113
std::string experimental_policy_integrity;
114114
bool has_policy_integrity_string;
115-
bool experimental_repl_await = false;
116115
bool experimental_vm_modules = false;
117116
bool expose_internals = false;
118117
bool frozen_intrinsics = false;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ assert(undocumented.delete('--no-debug-arraybuffer-allocations'));
9191
assert(undocumented.delete('--es-module-specifier-resolution'));
9292
assert(undocumented.delete('--experimental-report'));
9393
assert(undocumented.delete('--experimental-worker'));
94+
assert(undocumented.delete('--experimental-repl-await'));
9495
assert(undocumented.delete('--node-snapshot'));
9596
assert(undocumented.delete('--no-node-snapshot'));
9697
assert(undocumented.delete('--loader'));

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)