@@ -62,7 +62,7 @@ changes: |
62 | 62 | - v17.0.0 |
63 | 63 | - v16.12.0 |
64 | 64 | pr-url: https://github.com/nodejs/node/pull/40249 |
65 | | - description: Added support for import assertions to the |
| 65 | + description: Added support for import attributes to the |
66 | 66 | `importModuleDynamically` parameter. |
67 | 67 | - version: v10.6.0 |
68 | 68 | pr-url: https://github.com/nodejs/node/pull/20300 |
@@ -101,7 +101,7 @@ changes: |
101 | 101 | using it in a production environment. |
102 | 102 | * `specifier` {string} specifier passed to `import()` |
103 | 103 | * `script` {vm.Script} |
104 | | - * `importAssertions` {Object} The `"assert"` value passed to the |
| 104 | + * `importAttributes` {Object} The `"with"` value passed to the |
105 | 105 | [`optionsExpression`][] optional parameter, or an empty object if no value |
106 | 106 | was provided. |
107 | 107 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
@@ -615,6 +615,14 @@ The identifier of the current module, as set in the constructor. |
615 | 615 |
|
616 | 616 | ### `module.link(linker)` |
617 | 617 |
|
| 618 | +<!-- YAML |
| 619 | +changes: |
| 620 | + - version: REPLACEME |
| 621 | + pr-url: https://github.com/nodejs/node/pull/50141 |
| 622 | + description: The option `extra.assert` is renamed to `extra.attributes`. The |
| 623 | + former name is still provided for backward compatibility. |
| 624 | +--> |
| 625 | + |
618 | 626 | * `linker` {Function} |
619 | 627 | * `specifier` {string} The specifier of the requested module: |
620 | 628 | ```mjs |
@@ -625,15 +633,14 @@ The identifier of the current module, as set in the constructor. |
625 | 633 | * `referencingModule` {vm.Module} The `Module` object `link()` is called on. |
626 | 634 |
|
627 | 635 | * `extra` {Object} |
628 | | - * `assert` {Object} The data from the assertion: |
629 | | - <!-- eslint-skip --> |
630 | | - ```js |
631 | | - import foo from 'foo' assert { name: 'value' }; |
632 | | - // ^^^^^^^^^^^^^^^^^ the assertion |
| 636 | + * `attributes` {Object} The data from the attribute: |
| 637 | + ```mjs |
| 638 | + import foo from 'foo' with { name: 'value' }; |
| 639 | + // ^^^^^^^^^^^^^^^^^ the attribute |
633 | 640 | ``` |
634 | | - Per ECMA-262, hosts are expected to ignore assertions that they do not |
635 | | - support, as opposed to, for example, triggering an error if an |
636 | | - unsupported assertion is present. |
| 641 | + Per ECMA-262, hosts are expected to trigger an error if an |
| 642 | + unsupported attribute is present. |
| 643 | + * `assert` {Object} Alias for `extra.attributes`. |
637 | 644 |
|
638 | 645 | * Returns: {vm.Module|Promise} |
639 | 646 | * Returns: {Promise} |
@@ -732,7 +739,7 @@ changes: |
732 | 739 | - v17.0.0 |
733 | 740 | - v16.12.0 |
734 | 741 | pr-url: https://github.com/nodejs/node/pull/40249 |
735 | | - description: Added support for import assertions to the |
| 742 | + description: Added support for import attributes to the |
736 | 743 | `importModuleDynamically` parameter. |
737 | 744 | --> |
738 | 745 |
|
@@ -762,7 +769,7 @@ changes: |
762 | 769 | `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. |
763 | 770 | * `specifier` {string} specifier passed to `import()` |
764 | 771 | * `module` {vm.Module} |
765 | | - * `importAssertions` {Object} The `"assert"` value passed to the |
| 772 | + * `importAttributes` {Object} The `"with"` value passed to the |
766 | 773 | [`optionsExpression`][] optional parameter, or an empty object if no value |
767 | 774 | was provided. |
768 | 775 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
@@ -977,7 +984,7 @@ changes: |
977 | 984 | - v17.0.0 |
978 | 985 | - v16.12.0 |
979 | 986 | pr-url: https://github.com/nodejs/node/pull/40249 |
980 | | - description: Added support for import assertions to the |
| 987 | + description: Added support for import attributes to the |
981 | 988 | `importModuleDynamically` parameter. |
982 | 989 | - version: v15.9.0 |
983 | 990 | pr-url: https://github.com/nodejs/node/pull/35431 |
@@ -1021,7 +1028,7 @@ changes: |
1021 | 1028 | considered stable. |
1022 | 1029 | * `specifier` {string} specifier passed to `import()` |
1023 | 1030 | * `function` {Function} |
1024 | | - * `importAssertions` {Object} The `"assert"` value passed to the |
| 1031 | + * `importAttributes` {Object} The `"with"` value passed to the |
1025 | 1032 | [`optionsExpression`][] optional parameter, or an empty object if no value |
1026 | 1033 | was provided. |
1027 | 1034 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
@@ -1207,7 +1214,7 @@ changes: |
1207 | 1214 | - v17.0.0 |
1208 | 1215 | - v16.12.0 |
1209 | 1216 | pr-url: https://github.com/nodejs/node/pull/40249 |
1210 | | - description: Added support for import assertions to the |
| 1217 | + description: Added support for import attributes to the |
1211 | 1218 | `importModuleDynamically` parameter. |
1212 | 1219 | - version: v6.3.0 |
1213 | 1220 | pr-url: https://github.com/nodejs/node/pull/6635 |
@@ -1245,7 +1252,7 @@ changes: |
1245 | 1252 | using it in a production environment. |
1246 | 1253 | * `specifier` {string} specifier passed to `import()` |
1247 | 1254 | * `script` {vm.Script} |
1248 | | - * `importAssertions` {Object} The `"assert"` value passed to the |
| 1255 | + * `importAttributes` {Object} The `"with"` value passed to the |
1249 | 1256 | [`optionsExpression`][] optional parameter, or an empty object if no value |
1250 | 1257 | was provided. |
1251 | 1258 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
@@ -1285,7 +1292,7 @@ changes: |
1285 | 1292 | - v17.0.0 |
1286 | 1293 | - v16.12.0 |
1287 | 1294 | pr-url: https://github.com/nodejs/node/pull/40249 |
1288 | | - description: Added support for import assertions to the |
| 1295 | + description: Added support for import attributes to the |
1289 | 1296 | `importModuleDynamically` parameter. |
1290 | 1297 | - version: v14.6.0 |
1291 | 1298 | pr-url: https://github.com/nodejs/node/pull/34023 |
@@ -1344,7 +1351,7 @@ changes: |
1344 | 1351 | using it in a production environment. |
1345 | 1352 | * `specifier` {string} specifier passed to `import()` |
1346 | 1353 | * `script` {vm.Script} |
1347 | | - * `importAssertions` {Object} The `"assert"` value passed to the |
| 1354 | + * `importAttributes` {Object} The `"with"` value passed to the |
1348 | 1355 | [`optionsExpression`][] optional parameter, or an empty object if no value |
1349 | 1356 | was provided. |
1350 | 1357 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
@@ -1388,7 +1395,7 @@ changes: |
1388 | 1395 | - v17.0.0 |
1389 | 1396 | - v16.12.0 |
1390 | 1397 | pr-url: https://github.com/nodejs/node/pull/40249 |
1391 | | - description: Added support for import assertions to the |
| 1398 | + description: Added support for import attributes to the |
1392 | 1399 | `importModuleDynamically` parameter. |
1393 | 1400 | - version: v6.3.0 |
1394 | 1401 | pr-url: https://github.com/nodejs/node/pull/6635 |
@@ -1424,7 +1431,7 @@ changes: |
1424 | 1431 | using it in a production environment. |
1425 | 1432 | * `specifier` {string} specifier passed to `import()` |
1426 | 1433 | * `script` {vm.Script} |
1427 | | - * `importAssertions` {Object} The `"assert"` value passed to the |
| 1434 | + * `importAttributes` {Object} The `"with"` value passed to the |
1428 | 1435 | [`optionsExpression`][] optional parameter, or an empty object if no value |
1429 | 1436 | was provided. |
1430 | 1437 | * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is |
|