diff options
author | Guy Bedford <guybedford@gmail.com> | 2019-10-12 00:57:13 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-13 01:04:55 +0300 |
commit | 796f3d0af49164314868c4778af90eca356f1fef (patch) | |
tree | f1b8d619df36917b03ba035630f389e1da305712 /lib/internal/main | |
parent | cc6f99de449beb0993db3647de4ef979bead804d (diff) |
esm: unflag --experimental-modules
PR-URL: https://github.com/nodejs/node/pull/29866
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'lib/internal/main')
-rw-r--r-- | lib/internal/main/check_syntax.js | 27 | ||||
-rw-r--r-- | lib/internal/main/run_main_module.js | 5 |
2 files changed, 14 insertions, 18 deletions
diff --git a/lib/internal/main/check_syntax.js b/lib/internal/main/check_syntax.js index a3aba9a00fb..c5d919bd15b 100644 --- a/lib/internal/main/check_syntax.js +++ b/lib/internal/main/check_syntax.js @@ -47,21 +47,18 @@ if (process.argv[1] && process.argv[1] !== '-') { function checkSyntax(source, filename) { const { getOptionValue } = require('internal/options'); - const experimentalModules = getOptionValue('--experimental-modules'); - if (experimentalModules) { - let isModule = false; - if (filename === '[stdin]' || filename === '[eval]') { - isModule = getOptionValue('--input-type') === 'module'; - } else { - const resolve = require('internal/modules/esm/default_resolve'); - const { format } = resolve(pathToFileURL(filename).toString()); - isModule = format === 'module'; - } - if (isModule) { - const { ModuleWrap } = internalBinding('module_wrap'); - new ModuleWrap(filename, undefined, source, 0, 0); - return; - } + let isModule = false; + if (filename === '[stdin]' || filename === '[eval]') { + isModule = getOptionValue('--input-type') === 'module'; + } else { + const resolve = require('internal/modules/esm/default_resolve'); + const { format } = resolve(pathToFileURL(filename).toString()); + isModule = format === 'module'; + } + if (isModule) { + const { ModuleWrap } = internalBinding('module_wrap'); + new ModuleWrap(filename, undefined, source, 0, 0); + return; } wrapSafe(filename, source); diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js index 77d997b97a1..eae9042041a 100644 --- a/lib/internal/main/run_main_module.js +++ b/lib/internal/main/run_main_module.js @@ -10,7 +10,6 @@ const CJSModule = require('internal/modules/cjs/loader').Module; markBootstrapComplete(); -// Note: this loads the module through the ESM loader if -// --experimental-loader is provided or --experimental-modules is on -// and the module is determined to be an ES module +// Note: this loads the module through the ESM loader if the module is +// determined to be an ES module CJSModule.runMain(process.argv[1]); |