|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= < [email protected]> |
| 3 | +Date: Fri, 19 Apr 2024 02:01:24 +0200 |
| 4 | +Subject: esm: drop support for import assertions |
| 5 | + |
| 6 | +This patch removes support for the `assert` keyword |
| 7 | +for import attributes. It was an old variant of the |
| 8 | +proposal that was only shipped in V8 and no other |
| 9 | +engine, and that has then been replaced by the `with` |
| 10 | +keyword. |
| 11 | + |
| 12 | +Chrome is planning to remove support for `assert` |
| 13 | +in version 126, which will be released in June. |
| 14 | + |
| 15 | +Node.js already supports the `with` keyword for |
| 16 | +import attributes, and this patch does not change that. |
| 17 | + |
| 18 | +PR-URL: https://github.com/nodejs/node/pull/52104 |
| 19 | +Reviewed-By: Matteo Collina < [email protected]> |
| 20 | +Reviewed-By: Joyee Cheung < [email protected]> |
| 21 | +Reviewed-By: Yagiz Nizipli < [email protected]> |
| 22 | +Reviewed-By: Ethan Arrowood < [email protected]> |
| 23 | +Reviewed-By: Geoffrey Booth < [email protected]> |
| 24 | +(cherry picked from commit 25c79f333104d1feb0d84794d5bcdb4227177c9b) |
| 25 | + |
| 26 | +esm: remove --no-import-harmony-assertions |
| 27 | + |
| 28 | +It is off by default now. |
| 29 | + |
| 30 | +PR-URL: https://github.com/nodejs/node/pull/54890 |
| 31 | +Reviewed-By: Luigi Pinca < [email protected]> |
| 32 | +Reviewed-By: Yagiz Nizipli < [email protected]> |
| 33 | +Reviewed-By: Antoine du Hamel < [email protected]> |
| 34 | +Reviewed-By: James M Snell < [email protected]> |
| 35 | +(cherry picked from commit 8fd90938f923ef2a04bb3ebb08b89568fe6fd4ee) |
| 36 | + |
| 37 | +diff --git a/src/node.cc b/src/node.cc |
| 38 | +index 9f6f8e53abd7e447d88c187c447431a0d96cd150..4415f18ecbd84c1f41e0febbf2446fb636242d58 100644 |
| 39 | +--- a/src/node.cc |
| 40 | ++++ b/src/node.cc |
| 41 | +@@ -778,12 +778,6 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args, |
| 42 | + return ExitCode::kInvalidCommandLineArgument2; |
| 43 | + } |
| 44 | + |
| 45 | +- // TODO(aduh95): remove this when the harmony-import-assertions flag |
| 46 | +- // is removed in V8. |
| 47 | +- if (std::find(v8_args.begin(), v8_args.end(), |
| 48 | +- "--no-harmony-import-assertions") == v8_args.end()) { |
| 49 | +- v8_args.emplace_back("--harmony-import-assertions"); |
| 50 | +- } |
| 51 | + // TODO(aduh95): remove this when the harmony-import-attributes flag |
| 52 | + // is removed in V8. |
| 53 | + if (std::find(v8_args.begin(), |
0 commit comments