module: remove experimental modules warning

PR-URL: https://github.com/nodejs/node/pull/31974
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Guy Bedford 2020-02-26 22:32:08 +02:00 committed by Myles Borins
parent 5e807c1fd2
commit 22b6997aba
No known key found for this signature in database
GPG Key ID: 933B01F40B5CA946
10 changed files with 4 additions and 33 deletions

View File

@ -3,7 +3,6 @@
const {
ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING,
} = require('internal/errors').codes;
const assert = require('internal/assert');
const { Loader } = require('internal/modules/esm/loader');
const { pathToFileURL } = require('internal/url');
const {
@ -23,13 +22,6 @@ exports.initializeImportMetaObject = function(wrap, meta) {
};
exports.importModuleDynamicallyCallback = async function(wrap, specifier) {
assert(calledInitialize === true || !userLoader);
if (!calledInitialize) {
process.emitWarning(
'The ESM module loader is experimental.',
'ExperimentalWarning', undefined);
calledInitialize = true;
}
const { callbackMap } = internalBinding('module_wrap');
if (callbackMap.has(wrap)) {
const { importModuleDynamically } = callbackMap.get(wrap);
@ -44,14 +36,8 @@ exports.importModuleDynamicallyCallback = async function(wrap, specifier) {
let ESMLoader = new Loader();
exports.ESMLoader = ESMLoader;
let calledInitialize = false;
exports.initializeLoader = initializeLoader;
async function initializeLoader() {
assert(calledInitialize === false);
process.emitWarning(
'The ESM module loader is experimental.',
'ExperimentalWarning', undefined);
calledInitialize = true;
if (!userLoader)
return;
let cwd;

View File

@ -42,9 +42,6 @@ function expectFsNamespace(result) {
// For direct use of import expressions inside of CJS or ES modules, including
// via eval, all kinds of specifiers should work without issue.
(function testScriptOrModuleImport() {
common.expectWarning('ExperimentalWarning',
'The ESM module loader is experimental.');
// Importing another file, both direct & via eval
// expectOkNamespace(import(relativePath));
expectOkNamespace(eval(`import("${relativePath}")`));

View File

@ -16,7 +16,7 @@ child.stderr.on('data', (data) => {
child.on('close', (code, signal) => {
strictEqual(code, 0);
strictEqual(signal, null);
ok(stderr.toString().includes(
ok(!stderr.toString().includes(
'ExperimentalWarning: The ESM module loader is experimental'
));
ok(!stderr.toString().includes(

View File

@ -1,5 +1,3 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
Error: test
at one (*fixtures*async-error.js:4:9)
at two (*fixtures*async-error.js:17:9)

View File

@ -1,5 +1,3 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
file:///*/test/message/esm_display_syntax_error.mjs:2
await async () => 0;
^^^^^

View File

@ -1,5 +1,3 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
file:///*/test/message/esm_display_syntax_error_import.mjs:5
notfound
^^^^^^^^

View File

@ -1,5 +1,3 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
file:///*/test/fixtures/es-module-loaders/syntax-error-import.mjs:1
import { foo, notfound } from './module-named-exports.mjs';
^^^^^^^^

View File

@ -1,8 +1,6 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
file:///*/test/fixtures/es-module-loaders/syntax-error.mjs:2
await async () => 0;
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:*:*)
at Loader.moduleStrategy (internal/modules/esm/translators.js:*:*)

View File

@ -1,6 +1,5 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
internal/modules/run_main.js:*
internalBinding('errors').triggerUncaughtException(
^

View File

@ -1,6 +1,5 @@
(node:*) ExperimentalWarning: The ESM module loader is experimental.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file://*/test/fixtures/es-module-loaders/syntax-error.mjs:2
await async () => 0;
^^^^^