summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJuan José Arboleda <soyjuanarbol@gmail.com>2019-11-29 16:30:25 -0500
committerGuy Bedford <guybedford@gmail.com>2019-12-06 23:07:56 -0500
commit6669cd138e918c6252e7c1dcb4bdfbc673105bad (patch)
tree3485f766a222ba0f96db5743667335aae0027d53 /lib
parentaa363c49eadabe45344986476b8388d66cfced37 (diff)
downloadandroid-node-v8-6669cd138e918c6252e7c1dcb4bdfbc673105bad.tar.gz
android-node-v8-6669cd138e918c6252e7c1dcb4bdfbc673105bad.tar.bz2
android-node-v8-6669cd138e918c6252e7c1dcb4bdfbc673105bad.zip
lib: add warning on dynamic import es modules
PR-URL: https://github.com/nodejs/node/pull/30720 Reviewed-By: Guy Bedford <guybedford@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/process/esm_loader.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/internal/process/esm_loader.js b/lib/internal/process/esm_loader.js
index 19099d9cbd..404be77338 100644
--- a/lib/internal/process/esm_loader.js
+++ b/lib/internal/process/esm_loader.js
@@ -24,6 +24,12 @@ 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);