From c13969e52a05e2ab1ab778fa64b5dde922aefbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 12 Dec 2023 19:18:24 +0100 Subject: [PATCH] deps: V8: cherry-pick ea996ad04a68 Original commit message: [import-attributes] Remove support for numeric keys During the 2023-09 TC39 meeting the proposal has been updated to remove support for bigint and float literals as import attribute keys, due to implementation difficulties in other engines and minimal added value for JS developers. GH issue: https://github.com/tc39/proposal-import-attributes/issues/145 Bug: v8:13856 Change-Id: I0ede2bb10d6ca338a4b0870a1261ccbcd088c16f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4899760 Reviewed-by: Shu-yu Guo Commit-Queue: Joyee Cheung Cr-Commit-Position: refs/heads/main@{#90318} Refs: https://github.com/v8/v8/commit/ea996ad04a684e32cd93018f0aad2f46e6b86975 PR-URL: https://github.com/nodejs/node/pull/51136 Reviewed-By: Yagiz Nizipli --- deps/v8/src/parsing/parser.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc index 92beebba5233ac..4a60275a546d30 100644 --- a/deps/v8/src/parsing/parser.cc +++ b/deps/v8/src/parsing/parser.cc @@ -1378,16 +1378,8 @@ ImportAssertions* Parser::ParseImportAssertClause() { Expect(Token::LBRACE); while (peek() != Token::RBRACE) { - const AstRawString* attribute_key = nullptr; - if (Check(Token::STRING) || Check(Token::SMI)) { - attribute_key = GetSymbol(); - } else if (Check(Token::NUMBER)) { - attribute_key = GetNumberAsSymbol(); - } else if (Check(Token::BIGINT)) { - attribute_key = GetBigIntAsSymbol(); - } else { - attribute_key = ParsePropertyName(); - } + const AstRawString* attribute_key = + Check(Token::STRING) ? GetSymbol() : ParsePropertyName(); Scanner::Location location = scanner()->location();