diff --git a/doc/api/esm.md b/doc/api/esm.md index 7e423634183d5d..3d09cc03bba696 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -566,8 +566,6 @@ would provide the exports interface for the instantiation of `module.wasm`. added: v14.8.0 --> -> Stability: 1 - Experimental - The `await` keyword may be used in the top level body of an ECMAScript module. Assuming an `a.mjs` with diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 1e049d7258d21c..50ce8d510cb1a4 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -428,13 +428,7 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo& args) { return; } - // If TLA is enabled, `result` is the evaluation's promise. - // Otherwise, `result` is the last evaluated value of the module, - // which could be a promise, which would result in it being incorrectly - // unwrapped when the higher level code awaits the evaluation. - if (env->isolate_data()->options()->experimental_top_level_await) { - args.GetReturnValue().Set(result.ToLocalChecked()); - } + args.GetReturnValue().Set(result.ToLocalChecked()); } void ModuleWrap::GetNamespace(const FunctionCallbackInfo& args) { diff --git a/src/node_options.cc b/src/node_options.cc index dae1ce1866f488..8341724089a3a1 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -700,14 +700,8 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( kAllowedInEnvironment); Implies("--report-signal", "--report-on-signal"); - AddOption("--experimental-top-level-await", - "", - &PerIsolateOptions::experimental_top_level_await, - kAllowedInEnvironment); - AddOption("--harmony-top-level-await", "", V8Option{}); - Implies("--experimental-top-level-await", "--harmony-top-level-await"); - Implies("--harmony-top-level-await", "--experimental-top-level-await"); - ImpliesNot("--no-harmony-top-level-await", "--experimental-top-level-await"); + AddOption( + "--experimental-top-level-await", "", NoOp{}, kAllowedInEnvironment); Insert(eop, &PerIsolateOptions::get_per_env_options); } diff --git a/src/node_options.h b/src/node_options.h index a623f881b7ecba..a3937900b41201 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -205,7 +205,6 @@ class PerIsolateOptions : public Options { bool track_heap_objects = false; bool report_uncaught_exception = false; bool report_on_signal = false; - bool experimental_top_level_await = true; std::string report_signal = "SIGUSR2"; inline EnvironmentOptions* get_per_env_options(); void CheckOptions(std::vector* errors) override;