Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhimself65 <himself65@outlook.com>2020-09-08 10:45:58 +0300
committerRich Trott <rtrott@gmail.com>2020-09-10 17:58:08 +0300
commit22c52aac6ace9154e9424c2994289ee4dde12bab (patch)
tree50ed881ba73a44dc9092c6c7f7411824a9c2041b /src
parentb7f3e8308661c3e370b4ebb863109655653d106f (diff)
module: fix specifier resolution option value
Fixes: https://github.com/nodejs/node/issues/35095 PR-URL: https://github.com/nodejs/node/pull/35098 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_options.cc21
-rw-r--r--src/node_options.h1
2 files changed, 3 insertions, 19 deletions
diff --git a/src/node_options.cc b/src/node_options.cc
index 671cdc591e0..abbb7bc82ab 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -92,20 +92,7 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
}
}
- if (!es_module_specifier_resolution.empty()) {
- if (!experimental_specifier_resolution.empty()) {
- errors->push_back(
- "bad option: cannot use --es-module-specifier-resolution"
- " and --experimental-specifier-resolution at the same time");
- } else {
- experimental_specifier_resolution = es_module_specifier_resolution;
- if (experimental_specifier_resolution != "node" &&
- experimental_specifier_resolution != "explicit") {
- errors->push_back(
- "invalid value for --es-module-specifier-resolution");
- }
- }
- } else if (!experimental_specifier_resolution.empty()) {
+ if (!experimental_specifier_resolution.empty()) {
if (experimental_specifier_resolution != "node" &&
experimental_specifier_resolution != "explicit") {
errors->push_back(
@@ -368,10 +355,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"either 'explicit' (default) or 'node'",
&EnvironmentOptions::experimental_specifier_resolution,
kAllowedInEnvironment);
- AddOption("--es-module-specifier-resolution",
- "",
- &EnvironmentOptions::es_module_specifier_resolution,
- kAllowedInEnvironment);
+ AddAlias("--es-module-specifier-resolution",
+ "--experimental-specifier-resolution");
AddOption("--no-deprecation",
"silence deprecation warnings",
&EnvironmentOptions::no_deprecation,
diff --git a/src/node_options.h b/src/node_options.h
index 3258d4b3f0d..bd63fcb0485 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -105,7 +105,6 @@ class EnvironmentOptions : public Options {
bool experimental_json_modules = false;
bool experimental_modules = false;
std::string experimental_specifier_resolution;
- std::string es_module_specifier_resolution;
bool experimental_wasm_modules = false;
bool experimental_import_meta_resolve = false;
std::string module_type;