3
3
const {
4
4
ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING ,
5
5
} = require ( 'internal/errors' ) . codes ;
6
- const assert = require ( 'internal/assert' ) ;
7
6
const { Loader } = require ( 'internal/modules/esm/loader' ) ;
8
7
const { pathToFileURL } = require ( 'internal/url' ) ;
9
8
const {
@@ -23,13 +22,6 @@ exports.initializeImportMetaObject = function(wrap, meta) {
23
22
} ;
24
23
25
24
exports . importModuleDynamicallyCallback = async function ( wrap , specifier ) {
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
- }
33
25
const { callbackMap } = internalBinding ( 'module_wrap' ) ;
34
26
if ( callbackMap . has ( wrap ) ) {
35
27
const { importModuleDynamically } = callbackMap . get ( wrap ) ;
@@ -44,14 +36,8 @@ exports.importModuleDynamicallyCallback = async function(wrap, specifier) {
44
36
let ESMLoader = new Loader ( ) ;
45
37
exports . ESMLoader = ESMLoader ;
46
38
47
- let calledInitialize = false ;
48
39
exports . initializeLoader = initializeLoader ;
49
40
async function initializeLoader ( ) {
50
- assert ( calledInitialize === false ) ;
51
- process . emitWarning (
52
- 'The ESM module loader is experimental.' ,
53
- 'ExperimentalWarning' , undefined ) ;
54
- calledInitialize = true ;
55
41
if ( ! userLoader )
56
42
return ;
57
43
let cwd ;
0 commit comments