| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,12 @@ exports.initializeImportMetaObject = function(wrap, meta) { | |||
| 24 | 24 | ||
| 25 | 25 | exports.importModuleDynamicallyCallback = async function(wrap, specifier) { | |
| 26 | 26 | assert(calledInitialize === true || !userLoader); | |
| 27 | + if (!calledInitialize) { | ||
| 28 | + process.emitWarning( | ||
| 29 | + 'The ESM module loader is experimental.', | ||
| 30 | + 'ExperimentalWarning', undefined); | ||
| 31 | + calledInitialize = true; | ||
| 32 | + } | ||
| 27 | 33 | const { callbackMap } = internalBinding('module_wrap'); | |
| 28 | 34 | if (callbackMap.has(wrap)) { | |
| 29 | 35 | const { importModuleDynamically } = callbackMap.get(wrap); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,6 +42,9 @@ function expectFsNamespace(result) { | |||
| 42 | 42 | // For direct use of import expressions inside of CJS or ES modules, including | |
| 43 | 43 | // via eval, all kinds of specifiers should work without issue. | |
| 44 | 44 | (function testScriptOrModuleImport() { | |
| 45 | + common.expectWarning('ExperimentalWarning', | ||
| 46 | + 'The ESM module loader is experimental.'); | ||
| 47 | + | ||
| 45 | 48 | // Importing another file, both direct & via eval | |
| 46 | 49 | // expectOkNamespace(import(relativePath)); | |
| 47 | 50 | expectOkNamespace(eval(`import("${relativePath}")`)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments