Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 992af4e

Browse filesBrowse files
himself65MylesBorins
authored andcommitted
module: fix specifier resolution option value
Fixes: #35095 PR-URL: #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>
1 parent 85c47d7 commit 992af4e
Copy full SHA for 992af4e

File tree

Expand file treeCollapse file tree

4 files changed

+12
-37
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+12
-37
lines changed
Open diff view settings
Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
+3-18Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,7 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
9292
}
9393
}
9494

95-
if (!es_module_specifier_resolution.empty()) {
96-
if (!experimental_specifier_resolution.empty()) {
97-
errors->push_back(
98-
"bad option: cannot use --es-module-specifier-resolution"
99-
" and --experimental-specifier-resolution at the same time");
100-
} else {
101-
experimental_specifier_resolution = es_module_specifier_resolution;
102-
if (experimental_specifier_resolution != "node" &&
103-
experimental_specifier_resolution != "explicit") {
104-
errors->push_back(
105-
"invalid value for --es-module-specifier-resolution");
106-
}
107-
}
108-
} else if (!experimental_specifier_resolution.empty()) {
95+
if (!experimental_specifier_resolution.empty()) {
10996
if (experimental_specifier_resolution != "node" &&
11097
experimental_specifier_resolution != "explicit") {
11198
errors->push_back(
@@ -377,10 +364,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
377364
"either 'explicit' (default) or 'node'",
378365
&EnvironmentOptions::experimental_specifier_resolution,
379366
kAllowedInEnvironment);
380-
AddOption("--es-module-specifier-resolution",
381-
"",
382-
&EnvironmentOptions::es_module_specifier_resolution,
383-
kAllowedInEnvironment);
367+
AddAlias("--es-module-specifier-resolution",
368+
"--experimental-specifier-resolution");
384369
AddOption("--no-deprecation",
385370
"silence deprecation warnings",
386371
&EnvironmentOptions::no_deprecation,
Collapse file

‎src/node_options.h‎

Copy file name to clipboardExpand all lines: src/node_options.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class EnvironmentOptions : public Options {
105105
bool experimental_json_modules = false;
106106
bool experimental_modules = false;
107107
std::string experimental_specifier_resolution;
108-
std::string es_module_specifier_resolution;
109108
bool experimental_wasm_modules = false;
110109
bool experimental_import_meta_resolve = false;
111110
std::string module_type;
Collapse file

‎test/es-module/test-esm-specifiers-both-flags.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-specifiers-both-flags.mjs
-14Lines changed: 0 additions & 14 deletions
This file was deleted.
Collapse file

‎test/es-module/test-esm-specifiers.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-specifiers.mjs
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ main().catch(mustNotCall);
4949
'../../fixtures/es-module-specifiers',
5050
item,
5151
);
52-
spawn(process.execPath,
53-
['--es-module-specifier-resolution=node', modulePath],
54-
{ stdio: 'inherit' }).on('exit', (code) => {
55-
assert.strictEqual(code, 0);
52+
[
53+
'--experimental-specifier-resolution',
54+
'--es-module-specifier-resolution'
55+
].forEach((option) => {
56+
spawn(process.execPath,
57+
[`${option}=node`, modulePath],
58+
{ stdio: 'inherit' }).on('exit', (code) => {
59+
assert.strictEqual(code, 0);
60+
});
5661
});
5762
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.