From a9d6eb4ad1a21f34d723a1322389ef8c1b7654a7 Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Thu, 8 Jul 2021 18:33:54 +0000 Subject: [PATCH 01/10] 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. --- doc/api/cli.md | 8 -------- doc/api/repl.md | 4 +--- doc/node.1 | 5 ----- lib/repl.js | 5 +---- src/node_options.cc | 2 +- src/node_options.h | 1 - .../test-process-env-allowed-flags-are-documented.js | 1 + test/parallel/test-repl-import-referrer.js | 2 +- test/parallel/test-repl-top-level-await.js | 2 +- 9 files changed, 6 insertions(+), 24 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index f4f0ed4e98b971..bac785ece1e2f2 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -279,13 +279,6 @@ added: v11.8.0 Use the specified file as a security policy. -### `--experimental-repl-await` - - -Enable experimental top-level `await` keyword support in REPL. - ### `--experimental-specifier-resolution=mode` + Use this flag to disable top-level await in REPL. + ### `--experimental-specifier-resolution=mode` Use this flag to disable top-level await in REPL. From 1aafad683c92891487b31b8f550eb8e08bb77a5f Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 13 Jul 2021 10:11:56 -0700 Subject: [PATCH 04/10] Update doc/api/cli.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michaël Zasso --- doc/api/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 4e547eacb193ca..dfbfb30df1847b 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -279,7 +279,7 @@ added: v11.8.0 Use the specified file as a security policy. -### `--no-experimetal-repl-await` +### `--no-experimental-repl-await` From e5c977f60270be256fc57aa6ce1c80d085f59f5d Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 13 Jul 2021 10:12:05 -0700 Subject: [PATCH 05/10] Update src/node_options.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michaël Zasso --- src/node_options.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node_options.cc b/src/node_options.cc index b76e2e1d027e5a..46bb483e4064dc 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -350,7 +350,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { "experimental await keyword support in REPL", NoOp{}, kAllowedInEnvironment); - ImpliesNot("--experimental-repl-await", "--no-experimental-repl-await"); AddOption("--experimental-vm-modules", "experimental ES Module support in vm module", &EnvironmentOptions::experimental_vm_modules, From fda3e7bfd54b51a68bb3193b3e8c6be08bb793db Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 13 Jul 2021 10:12:18 -0700 Subject: [PATCH 06/10] Update test/parallel/test-process-env-allowed-flags-are-documented.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michaël Zasso --- test/parallel/test-process-env-allowed-flags-are-documented.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js index 40f1dc4fe89655..64626b71f01902 100644 --- a/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js @@ -91,7 +91,6 @@ assert(undocumented.delete('--no-debug-arraybuffer-allocations')); assert(undocumented.delete('--es-module-specifier-resolution')); assert(undocumented.delete('--experimental-report')); assert(undocumented.delete('--experimental-worker')); -assert(undocumented.delete('--experimental-repl-await')); assert(undocumented.delete('--node-snapshot')); assert(undocumented.delete('--no-node-snapshot')); assert(undocumented.delete('--loader')); From b9fced92a65b894ac396823a0e2dfcc49c2812a1 Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 13 Jul 2021 10:12:28 -0700 Subject: [PATCH 07/10] Update src/node_options.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michaël Zasso --- src/node_options.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node_options.cc b/src/node_options.cc index 46bb483e4064dc..40f8cf8690294e 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -348,8 +348,9 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { Implies("--policy-integrity", "[has_policy_integrity_string]"); AddOption("--experimental-repl-await", "experimental await keyword support in REPL", - NoOp{}, - kAllowedInEnvironment); + &EnvironmentOptions::experimental_repl_await, + kAllowedInEnvironment, + true); AddOption("--experimental-vm-modules", "experimental ES Module support in vm module", &EnvironmentOptions::experimental_vm_modules, From b32662d39f47697cf76c7a4c01fcf6da1b838fc5 Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 13 Jul 2021 18:06:09 +0000 Subject: [PATCH 08/10] fixup: lint fix, link order. --- doc/api/repl.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/repl.md b/doc/api/repl.md index 1bca4d096a2967..998ab61800685b 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -249,7 +249,7 @@ undefined 234 ``` -P.S: Use [`--no-experimental-repl-await`][] if you ever wish to disable top-level await in your REPL. +[`--no-experimental-repl-await`][] shall disable top-level await in REPL. ### Reverse-i-search Use this flag to disable top-level await in REPL. From a9f1e000a58a69121f9a378072aa3e2900200737 Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Wed, 14 Jul 2021 23:54:58 +0000 Subject: [PATCH 10/10] fixup: alphabetic order of flags. --- doc/api/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 206b0fa3c04215..f4c2881cd2f5ea 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1402,7 +1402,6 @@ Node.js options that are allowed are: * `--experimental-policy` * `--experimental-specifier-resolution` * `--experimental-top-level-await` -* `--no-experimental-repl-await` * `--experimental-vm-modules` * `--experimental-wasi-unstable-preview1` * `--experimental-wasm-modules` @@ -1422,6 +1421,7 @@ Node.js options that are allowed are: * `--max-http-header-size` * `--napi-modules` * `--no-deprecation` +* `--no-experimental-repl-await` * `--no-force-async-hooks-checks` * `--no-warnings` * `--node-memory-debug`