| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 85c47d7 commit 992af4e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,20 +92,7 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) { | |||
| 92 | 92 | } | |
| 93 | 93 | } | |
| 94 | 94 | ||
| 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()) { | ||
| 109 | 96 | if (experimental_specifier_resolution != "node" && | |
| 110 | 97 | experimental_specifier_resolution != "explicit") { | |
| 111 | 98 | errors->push_back( | |
@@ -377,10 +364,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 377 | 364 | "either 'explicit' (default) or 'node'", | |
| 378 | 365 | &EnvironmentOptions::experimental_specifier_resolution, | |
| 379 | 366 | 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"); | ||
| 384 | 369 | AddOption("--no-deprecation", | |
| 385 | 370 | "silence deprecation warnings", | |
| 386 | 371 | &EnvironmentOptions::no_deprecation, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -105,7 +105,6 @@ class EnvironmentOptions : public Options { | |||
| 105 | 105 | bool experimental_json_modules = false; | |
| 106 | 106 | bool experimental_modules = false; | |
| 107 | 107 | std::string experimental_specifier_resolution; | |
| 108 | - std::string es_module_specifier_resolution; | ||
| 109 | 108 | bool experimental_wasm_modules = false; | |
| 110 | 109 | bool experimental_import_meta_resolve = false; | |
| 111 | 110 | std::string module_type; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,9 +49,14 @@ main().catch(mustNotCall); | |||
| 49 | 49 | '../../fixtures/es-module-specifiers', | |
| 50 | 50 | item, | |
| 51 | 51 | ); | |
| 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 | + }); | ||
| 56 | 61 | }); | |
| 57 | 62 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments