@@ -88,7 +88,7 @@ changes:
88
88
This option is part of the experimental modules API, and should not be
89
89
considered stable.
90
90
* ` specifier ` {string} specifier passed to ` import() `
91
- * ` module ` {vm.Module }
91
+ * ` script ` {vm.Script }
92
92
* Returns: {Module Namespace Object|vm.Module} Returning a ` vm.Module ` is
93
93
recommended in order to take advantage of error tracking, and to avoid
94
94
issues with namespaces that contain ` then ` function exports.
@@ -773,6 +773,10 @@ const vm = require('vm');
773
773
## ` vm.compileFunction(code[, params[, options]])`
774
774
<!-- YAML
775
775
added: v10.10 .0
776
+ changes:
777
+ - version: REPLACEME
778
+ pr- url: https: // github.com/nodejs/node/pull/32985
779
+ description: The ` importModuleDynamically` option is now supported.
776
780
-->
777
781
778
782
* ` code` {string} The body of the function to compile.
@@ -795,6 +799,16 @@ added: v10.10.0
795
799
* `contextExtensions` {Object[]} An array containing a collection of context
796
800
extensions (objects wrapping the current scope ) to be applied while
797
801
compiling. **Default:** `[]`.
802
+ * `importModuleDynamically` {Function } Called during evaluation of this module
803
+ when ` import()` is called . If this option is not specified, calls to
804
+ ` import()` will reject with [` ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING` ][].
805
+ This option is part of the experimental modules API , and should not be
806
+ considered stable.
807
+ * ` specifier` {string} specifier passed to ` import()`
808
+ * ` function` {Function }
809
+ * Returns: {Module Namespace Object | vm .Module } Returning a ` vm.Module` is
810
+ recommended in order to take advantage of error tracking, and to avoid
811
+ issues with namespaces that contain ` then` function exports.
798
812
* Returns: {Function}
799
813
800
814
Compiles the given code into the provided context (if no context is
0 commit comments