@@ -88,7 +88,7 @@ changes:
8888 This option is part of the experimental modules API, and should not be
8989 considered stable.
9090 * ` specifier ` {string} specifier passed to ` import() `
91- * ` module ` {vm.Module }
91+ * ` script ` {vm.Script }
9292 * Returns: {Module Namespace Object|vm.Module} Returning a ` vm.Module ` is
9393 recommended in order to take advantage of error tracking, and to avoid
9494 issues with namespaces that contain ` then ` function exports.
@@ -773,6 +773,10 @@ const vm = require('vm');
773773## ` vm.compileFunction(code[, params[, options]])`
774774<!-- YAML
775775added: 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.
776780-->
777781
778782* ` code` {string} The body of the function to compile.
@@ -795,6 +799,16 @@ added: v10.10.0
795799 * `contextExtensions` {Object[]} An array containing a collection of context
796800 extensions (objects wrapping the current scope ) to be applied while
797801 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.
798812* Returns: {Function}
799813
800814Compiles the given code into the provided context (if no context is
0 commit comments