@@ -54,6 +54,10 @@ executed in specific contexts. |
54 | 54 | <!-- YAML |
55 | 55 | added: v0.3.1 |
56 | 56 | changes: |
| 57 | + - version: REPLACEME |
| 58 | + pr-url: https://github.com/nodejs/node/pull/40249 |
| 59 | + description: Added support for import assertions to the |
| 60 | + `importModuleDynamically` parameter. |
57 | 61 | - version: v10.6.0 |
58 | 62 | pr-url: https://github.com/nodejs/node/pull/20300 |
59 | 63 | description: The `produceCachedData` is deprecated in favour of |
@@ -91,6 +95,9 @@ changes: |
91 | 95 | using it in a production environment. |
92 | 96 | * `specifier` {string} specifier passed to `import()` |
93 | 97 | * `script` {vm.Script} |
| 98 | + * `importAssertions` {Object} The `"assert"` value passed to the |
| 99 | + [`optionsExpression`][] optional parameter, or an empty object if no value |
| 100 | + was provided. |
94 | 101 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
95 | 102 | recommended in order to take advantage of error tracking, and to avoid |
96 | 103 | issues with namespaces that contain `then` function exports. |
@@ -642,6 +649,13 @@ The `vm.SourceTextModule` class provides the [Source Text Module Record][] as |
642 | 649 | defined in the ECMAScript specification. |
643 | 650 |
|
644 | 651 | ### `new vm.SourceTextModule(code[, options])` |
| 652 | +<!-- YAML |
| 653 | +changes: |
| 654 | + - version: REPLACEME |
| 655 | + pr-url: https://github.com/nodejs/node/pull/40249 |
| 656 | + description: Added support for import assertions to the |
| 657 | + `importModuleDynamically` parameter. |
| 658 | +--> |
645 | 659 |
|
646 | 660 | * `code` {string} JavaScript Module code to parse |
647 | 661 | * `options` |
@@ -667,6 +681,9 @@ defined in the ECMAScript specification. |
667 | 681 | `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. |
668 | 682 | * `specifier` {string} specifier passed to `import()` |
669 | 683 | * `module` {vm.Module} |
| 684 | + * `importAssertions` {Object} The `"assert"` value passed to the |
| 685 | + [`optionsExpression`][] optional parameter, or an empty object if no value |
| 686 | + was provided. |
670 | 687 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
671 | 688 | recommended in order to take advantage of error tracking, and to avoid |
672 | 689 | issues with namespaces that contain `then` function exports. |
@@ -852,6 +869,10 @@ const vm = require('vm'); |
852 | 869 | <!-- YAML |
853 | 870 | added: v10.10.0 |
854 | 871 | changes: |
| 872 | + - version: REPLACEME |
| 873 | + pr-url: https://github.com/nodejs/node/pull/40249 |
| 874 | + description: Added support for import assertions to the |
| 875 | + `importModuleDynamically` parameter. |
855 | 876 | - version: v15.9.0 |
856 | 877 | pr-url: https://github.com/nodejs/node/pull/35431 |
857 | 878 | description: Added `importModuleDynamically` option again. |
@@ -893,6 +914,9 @@ changes: |
893 | 914 | considered stable. |
894 | 915 | * `specifier` {string} specifier passed to `import()` |
895 | 916 | * `function` {Function} |
| 917 | + * `importAssertions` {Object} The `"assert"` value passed to the |
| 918 | + [`optionsExpression`][] optional parameter, or an empty object if no value |
| 919 | + was provided. |
896 | 920 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
897 | 921 | recommended in order to take advantage of error tracking, and to avoid |
898 | 922 | issues with namespaces that contain `then` function exports. |
@@ -1068,6 +1092,10 @@ vm.measureMemory({ mode: 'detailed', execution: 'eager' }) |
1068 | 1092 | <!-- YAML |
1069 | 1093 | added: v0.3.1 |
1070 | 1094 | changes: |
| 1095 | + - version: REPLACEME |
| 1096 | + pr-url: https://github.com/nodejs/node/pull/40249 |
| 1097 | + description: Added support for import assertions to the |
| 1098 | + `importModuleDynamically` parameter. |
1071 | 1099 | - version: v6.3.0 |
1072 | 1100 | pr-url: https://github.com/nodejs/node/pull/6635 |
1073 | 1101 | description: The `breakOnSigint` option is supported now. |
@@ -1113,6 +1141,9 @@ changes: |
1113 | 1141 | using it in a production environment. |
1114 | 1142 | * `specifier` {string} specifier passed to `import()` |
1115 | 1143 | * `script` {vm.Script} |
| 1144 | + * `importAssertions` {Object} The `"assert"` value passed to the |
| 1145 | + [`optionsExpression`][] optional parameter, or an empty object if no value |
| 1146 | + was provided. |
1116 | 1147 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
1117 | 1148 | recommended in order to take advantage of error tracking, and to avoid |
1118 | 1149 | issues with namespaces that contain `then` function exports. |
@@ -1145,6 +1176,10 @@ console.log(contextObject); |
1145 | 1176 | <!-- YAML |
1146 | 1177 | added: v0.3.1 |
1147 | 1178 | changes: |
| 1179 | + - version: REPLACEME |
| 1180 | + pr-url: https://github.com/nodejs/node/pull/40249 |
| 1181 | + description: Added support for import assertions to the |
| 1182 | + `importModuleDynamically` parameter. |
1148 | 1183 | - version: v14.6.0 |
1149 | 1184 | pr-url: https://github.com/nodejs/node/pull/34023 |
1150 | 1185 | description: The `microtaskMode` option is supported now. |
@@ -1211,6 +1246,9 @@ changes: |
1211 | 1246 | using it in a production environment. |
1212 | 1247 | * `specifier` {string} specifier passed to `import()` |
1213 | 1248 | * `script` {vm.Script} |
| 1249 | + * `importAssertions` {Object} The `"assert"` value passed to the |
| 1250 | + [`optionsExpression`][] optional parameter, or an empty object if no value |
| 1251 | + was provided. |
1214 | 1252 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
1215 | 1253 | recommended in order to take advantage of error tracking, and to avoid |
1216 | 1254 | issues with namespaces that contain `then` function exports. |
@@ -1247,6 +1285,10 @@ console.log(contextObject); |
1247 | 1285 | <!-- YAML |
1248 | 1286 | added: v0.3.1 |
1249 | 1287 | changes: |
| 1288 | + - version: REPLACEME |
| 1289 | + pr-url: https://github.com/nodejs/node/pull/40249 |
| 1290 | + description: Added support for import assertions to the |
| 1291 | + `importModuleDynamically` parameter. |
1250 | 1292 | - version: v6.3.0 |
1251 | 1293 | pr-url: https://github.com/nodejs/node/pull/6635 |
1252 | 1294 | description: The `breakOnSigint` option is supported now. |
@@ -1290,6 +1332,9 @@ changes: |
1290 | 1332 | using it in a production environment. |
1291 | 1333 | * `specifier` {string} specifier passed to `import()` |
1292 | 1334 | * `script` {vm.Script} |
| 1335 | + * `importAssertions` {Object} The `"assert"` value passed to the |
| 1336 | + [`optionsExpression`][] optional parameter, or an empty object if no value |
| 1337 | + was provided. |
1293 | 1338 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
1294 | 1339 | recommended in order to take advantage of error tracking, and to avoid |
1295 | 1340 | issues with namespaces that contain `then` function exports. |
@@ -1452,6 +1497,7 @@ are not controllable through the timeout either. |
1452 | 1497 | [`Error`]: errors.md#class-error |
1453 | 1498 | [`URL`]: url.md#class-url |
1454 | 1499 | [`eval()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval |
| 1500 | +[`optionsExpression`]: https://tc39.es/proposal-import-assertions/#sec-evaluate-import-call |
1455 | 1501 | [`script.runInContext()`]: #scriptrunincontextcontextifiedobject-options |
1456 | 1502 | [`script.runInThisContext()`]: #scriptruninthiscontextoptions |
1457 | 1503 | [`url.origin`]: url.md#urlorigin |
|