vm: reject in importModuleDynamically without --experimental-vm-modules · nodejs/node@fe66e9d
@@ -98,7 +98,9 @@ changes:
9898 when `import()` is called. If this option is not specified, calls to
9999`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
100100 This option is part of the experimental modules API. We do not recommend
101- using it in a production environment.
101+ using it in a production environment. If `--experimental-vm-modules` isn't
102+ set, this callback will be ignored and calls to `import()` will reject with
103+[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`][].
102104* `specifier` {string} specifier passed to `import()`
103105* `script` {vm.Script}
104106* `importAttributes` {Object} The `"assert"` value passed to the
@@ -765,6 +767,9 @@ changes:
765767 * `importModuleDynamically` {Function} Called during evaluation of this module
766768 when `import()` is called. If this option is not specified, calls to
767769 `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
770+ If `--experimental-vm-modules` isn't set, this callback will be ignored
771+ and calls to `import()` will reject with
772+ [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`][].
768773* `specifier` {string} specifier passed to `import()`
769774* `module` {vm.Module}
770775* `importAttributes` {Object} The `"assert"` value passed to the
@@ -1022,7 +1027,9 @@ changes:
10221027 when `import()` is called. If this option is not specified, calls to
10231028`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
10241029 This option is part of the experimental modules API, and should not be
1025- considered stable.
1030+ considered stable. If `--experimental-vm-modules` isn't
1031+ set, this callback will be ignored and calls to `import()` will reject with
1032+[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`][].
10261033* `specifier` {string} specifier passed to `import()`
10271034* `function` {Function}
10281035* `importAttributes` {Object} The `"assert"` value passed to the
@@ -1246,7 +1253,9 @@ changes:
12461253 when `import()` is called. If this option is not specified, calls to
12471254`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
12481255 This option is part of the experimental modules API. We do not recommend
1249- using it in a production environment.
1256+ using it in a production environment. If `--experimental-vm-modules` isn't
1257+ set, this callback will be ignored and calls to `import()` will reject with
1258+[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`][].
12501259* `specifier` {string} specifier passed to `import()`
12511260* `script` {vm.Script}
12521261* `importAttributes` {Object} The `"assert"` value passed to the
@@ -1345,7 +1354,9 @@ changes:
13451354 when `import()` is called. If this option is not specified, calls to
13461355`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
13471356 This option is part of the experimental modules API. We do not recommend
1348- using it in a production environment.
1357+ using it in a production environment. If `--experimental-vm-modules` isn't
1358+ set, this callback will be ignored and calls to `import()` will reject with
1359+[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`][].
13491360* `specifier` {string} specifier passed to `import()`
13501361* `script` {vm.Script}
13511362* `importAttributes` {Object} The `"assert"` value passed to the
@@ -1425,7 +1436,9 @@ changes:
14251436 when `import()` is called. If this option is not specified, calls to
14261437`import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].
14271438 This option is part of the experimental modules API. We do not recommend
1428- using it in a production environment.
1439+ using it in a production environment. If `--experimental-vm-modules` isn't
1440+ set, this callback will be ignored and calls to `import()` will reject with
1441+[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`][].
14291442* `specifier` {string} specifier passed to `import()`
14301443* `script` {vm.Script}
14311444* `importAttributes` {Object} The `"assert"` value passed to the
@@ -1589,6 +1602,7 @@ are not controllable through the timeout either.
15891602[Source Text Module Record]: https://tc39.es/ecma262/#sec-source-text-module-records
15901603[Synthetic Module Record]: https://heycam.github.io/webidl/#synthetic-module-records
15911604[V8 Embedder's Guide]: https://v8.dev/docs/embed#contexts
1605+[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`]: errors.md#err_vm_dynamic_import_callback_missing_flag
15921606[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`]: errors.md#err_vm_dynamic_import_callback_missing
15931607[`ERR_VM_MODULE_STATUS`]: errors.md#err_vm_module_status
15941608[`Error`]: errors.md#class-error