summaryrefslogtreecommitdiff
path: root/test/es-module
AgeCommit message (Collapse)Author
2019-01-27assert: adjust loose assertionsRuben Bridgewater
This changes the loose deep equal comparison by using the same logic as done in the strict deep equal comparison besides comparing primitives loosely, not comparing symbol properties and not comparing the prototype. `assert.deepEqual` is still commenly used and this is likely the biggest pitfall. Most changes are only minor and won't have a big impact besides likely fixing user expectations. PR-URL: https://github.com/nodejs/node/pull/25008 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-27test: refactor stdio handling in test-esm-cjs-mainRichard Lau
Set encoding on the stderr/stdout streams instead of calling data.toString(). Don't assume the complete expected messages arrive in a single event. PR-URL: https://github.com/nodejs/node/pull/25169 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-25test: refactor test-esm-namespace.mjsRich Trott
Remove unused `name` argument that is different from a subsequent `name` argument in a different but nearby function. This was mildly confusing to me at first, so hopefully this change clarifies things for others reading the test. PR-URL: https://github.com/nodejs/node/pull/25117 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-18test: add signal check to test-esm-cjs-mainRich Trott
PR-URL: https://github.com/nodejs/node/pull/25073 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-15test: run eslint on test file and fix errorsRuben Bridgewater
This removes two entries from the eslint ignore file. One file does not exist anymore and the other one could easily be fixed. PR-URL: https://github.com/nodejs/node/pull/25009 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-12-15test: remove dead codeRuben Bridgewater
This is not used by the test anymore. PR-URL: https://github.com/nodejs/node/pull/25009 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-12-10tools: capitalize sentencesRuben Bridgewater
This adds the `capitalized-comments` eslint rule to verify that actual sentences use capital letters as starting letters. It ignores special words and all lines below 62 characters. PR-URL: https://github.com/nodejs/node/pull/24808 Reviewed-By: Sam Ruby <rubys@intertwingly.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-06vm: add dynamic import supportGus Caplan
PR-URL: https://github.com/nodejs/node/pull/22381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-08-04test: run ESM tests in parallelMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/21919 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-07-19test: make crashOnUnhandleRejection opt-outMichaël Zasso
This commit removes `common.crashOnUnhandledRejection()` and adds `common.disableCrashOnUnhandledRejection()`. To reduce the risk of mistakes and make writing tests that involve promises simpler, always install the unhandledRejection hook in tests and provide a way to disable it for the rare cases where it's needed. PR-URL: https://github.com/nodejs/node/pull/21849 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-07-03test: add test for missing dynamic instantiate hookMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/21506 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-06-30test: fix ESM testAnna Henningsen
The previously landed commit was broken and it’s too late to force-push. Fixing up the test seems to work. Refs: https://github.com/nodejs/node/pull/21352 PR-URL: https://github.com/nodejs/node/pull/21605 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-30esm: loader hook URL validation and error messagesguybedford
PR-URL: https://github.com/nodejs/node/pull/21352 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-06-24test: lint fixes for ESLint updatecjihrig
This commit introduces changes required for the ESLint 5 update. PR-URL: https://github.com/nodejs/node/pull/20855 Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-06-21module: experimental modules runMain separationguybedford
PR-URL: https://github.com/nodejs/node/pull/21350 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-06-18loader: remove unused error code in module_jobGus Caplan
PR-URL: https://github.com/nodejs/node/pull/21354 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-06-13esm: ensure require.main for CJS top-level loadsGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/21150 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-05-13module: add --preserve-symlinks-mainDavid Goldstein
Add `--preserve-symlinks-main` option which behaves like `--preserve-symlinks` but for `require.main`. PR-URL: https://github.com/nodejs/node/pull/19911 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-11esm: provide named exports for builtin libsGus Caplan
Provide named exports for all builtin libraries so that the libraries may be imported in a nicer way for esm users. The default export is left as the entire namespace (module.exports) and wrapped in a proxy such that APMs and other behavior are still left intact. PR-URL: https://github.com/nodejs/node/pull/20403 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com>
2018-04-10module: fix `e.stack` error when throwing undefined or nullZhenzhen Zhan
Adds a test for module loading when throwing undefined or null. PR-URL: https://github.com/nodejs/node/pull/19282 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-04-01module: skip preserveSymlinks for mainGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/19388 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-28lib: rename js source to lower snake_caseDaniel Bevenius
This commit renames all JavaScript source files in lib to lower snake_case. PR-URL: https://github.com/nodejs/node/pull/19556 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-25lib: always show ERR_INVALID_ARG_TYPE received partRuben Bridgewater
This makes a effort to make sure all of these errors will actually also show the received input. On top of that it refactors a few tests for better maintainability. It will also change the returned type to always be a simple typeof instead of special handling null. PR-URL: https://github.com/nodejs/node/pull/19445 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-03-21test: move ESM fixtures to fixtures dirMichaël Zasso
Also consistently import the `common` module where possible. PR-URL: https://github.com/nodejs/node/pull/19409 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-03-15lib: restructure cjs and esm loadersJoyee Cheung
Create `lib/internal/modules` and restructure the module loaders to make the purpose of those files clearer. Also make it clear in the code that the object exported by `lib/internal/modules/cjs/loader.js` is `CJSModule` instead of the ambiguous `Module`. Before: ``` lib ├── ... ├── internal │ ├── loaders │ │ ├── CreateDynamicModule.js │ │ ├── DefaultResolve.js │ │ ├── Loader.js │ │ ├── ModuleJob.js │ │ ├── ModuleMap.js │ │ └── Translators.js │ └── module.js └── module.js ``` After: ``` lib ├── ... ├── internal │ ├── ... │ └── modules │ ├── cjs │ │ ├── helpers.js │ │ └── loader.js │ └── esm │ ├── CreateDynamicModule.js │ ├── DefaultResolve.js │ ├── Loader.js │ ├── ModuleJob.js │ ├── ModuleMap.js │ └── Translators.js └── module.js # deleted in this commit to work with git file mode ``` PR-URL: https://github.com/nodejs/node/pull/19177 Refs: https://github.com/nodejs/node/pull/19112 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-03-07lib: port remaining errors to new systemMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/19137 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-03-05module: fix cyclical dynamic importBradley Farias
ensures that instantiation result is only used during initial loading PR-URL: https://github.com/nodejs/node/pull/18965 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-01test: specify 'dir' for directory symlinksKyle Farnung
Directory symlinks in Windows require the 'dir' flag to be passed to create the symlink correctly. PR-URL: https://github.com/nodejs/node/pull/19049 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-20lint: move eslint to new plugin systemGus Caplan
PR-URL: https://github.com/nodejs/node/pull/18566 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-02-16module: fix main lookup regression from #18728Guy Bedford
PR-URL: https://github.com/nodejs/node/pull/18788 Refs: https://github.com/nodejs/node/pull/18728 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-01src,lib: implement import.metaMichaël Zasso
Implement the C++ callback that is required to configure the `import.meta` object and add one property: - url: absolute URL of the module PR-URL: https://github.com/nodejs/node/pull/18368 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-01-31test: move tmpdir to submodule of commonRich Trott
Move tmpdir functionality to its own module (common/tmpdir). PR-URL: https://github.com/nodejs/node/pull/17856 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-01-31module: enable dynamic import flag for esmodulesMyles Borins
currently if you want to use dynamic import you must use both the `--experimental-modules` and the `--harmony-dynamic-imports` flags. Chrome is currently shipping dynamic import unflagged, the flag only remains in V8 to guard embedders who have not set the appropriate callback from throwing an unhandled rejection when the feature is used. As such it is reasonable to enable the flag by default for `--experimental-modules` PR-URL: https://github.com/nodejs/node/pull/18387 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-01-19test: replace assert.equal with assert.strictEqualSho Miyamoto
PR-URL: https://github.com/nodejs/node/pull/18119 Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-01-15module: refactor loaderGus Caplan
PR-URL: https://github.com/nodejs/node/pull/16874 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2017-11-29module: Set dynamic import callbackJan Krems
This is an initial implementation to support dynamic import in both scripts and modules. It's off by default since support for dynamic import is still flagged in V8. Without setting the V8 flag, this code won't be executed. This initial version does not support importing into vm contexts. PR-URL: https://github.com/nodejs/node/pull/15713 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2017-11-28module: fix for #17130 shared loader cjs depGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/17131 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2017-11-28test: add es6 module global leakage testsWhoMeNope
* created testing es6 module for global leakage tests * fixed a couple basic errors (vars -> lets, ...) * added globals leakage detection to es module tests * reversed whitespace change * whitespace change reversed PR-URL: https://github.com/nodejs/node/pull/16341 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-11-12loader: test search moduleCyril Lakech
PR-URL: https://github.com/nodejs/node/pull/16795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-01test: increase coverage for ModuleMapRob Paton
Add test for ModuleMap set with ModuleJob but bad url. PR-URL: https://github.com/nodejs/node/pull/16045 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-28module: fix hook module CJS dependency loadingguybedford
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: https://github.com/nodejs/node/pull/16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-10-21module: fix main resolution and not found updatesGuy Bedford
This simplifies the top-level load when ES modules are enabled as we can entirely delegate the module resolver, which will hand over to CommonJS where appropriate. All not found errors are made consistent to throw during resolve and have the MODULE_NOT_FOUND code. Includes the test case from https://github.com/nodejs/node/pull/15736. Fixes: https://github.com/nodejs/node/issues/15732 PR-URL: https://github.com/nodejs/node/pull/16147 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-16test: replace fixturesDir with fixtures modulehschwalm
PR-URL: https://github.com/nodejs/node/pull/15989 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-14module: allow loading files with % in the nameGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/16128 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bradley Meck <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-10-13test: fix test-esm-addonsRich Trott
Move test-esm-addons to test/addons/hello-world-esm. Test should now work properly on CI machines where `addons` are not always built at the expected relative path from the es-modules tests. Test should now work in Debug builds. PR-URL: https://github.com/nodejs/node/pull/16174 Fixes: https://github.com/nodejs/node/issues/16155 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-11module: resolve and instantiate loader pipeline hooksguybedford
This enables a --loader flag for Node, which can provide custom "resolve" and "dynamicInstantiate" methods for custom ES module loading. In the process, module providers have been converted from classes into functions and the module APIs have been made to pass URL strings over objects. PR-URL: https://github.com/nodejs/node/pull/15445 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-10-01test: update es-module.status prefixJack Horton
PR-URL: https://github.com/nodejs/node/pull/15690 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-27build: run es-module tests in CIBenjamin Coe
Add es-module to CI_JS_SUITES/js_test_suites, so that tests run in CI. Update test/README adding es-module section. PR-URL: https://github.com/nodejs/node/pull/15276 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-07module: Allow runMain to be ESMBradley Farias
This follows the EPS an allows the node CLI to have ESM as an entry point. `node ./example.mjs`. A newer V8 is needed for `import()` so that is not included. `import.meta` is still in specification stage so that also is not included. PR-URL: https://github.com/nodejs/node/pull/14369 Author: Bradley Farias <bradley.meck@gmail.com> Author: Guy Bedford <guybedford@gmail.com> Author: Jan Krems <jan.krems@groupon.com> Author: Timothy Gu <timothygu99@gmail.com> Author: Michaël Zasso <targos@protonmail.com> Author: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>