[parser] add support for BigInt literal as property names

Fixed: v8:10083
Change-Id: I50e01022b1d1219ad8b31dd71f58f5bc9c9d10bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1987845
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65719}
This commit is contained in:
legendecas 2020-01-10 22:14:10 +08:00 committed by Commit Bot
parent ee04007976
commit 52f88e1b93
3 changed files with 16 additions and 0 deletions

View File

@ -68,6 +68,7 @@ Bert Belder <bertbelder@gmail.com>
Burcu Dogan <burcujdogan@gmail.com>
Caitlin Potter <caitpotter88@gmail.com>
Craig Schlenter <craig.schlenter@gmail.com>
Chengzhong Wu <legendecas@gmail.com>
Choongwoo Han <cwhan.tunz@gmail.com>
Chris Nardi <hichris123@gmail.com>
Christopher A. Taylor <chris@gameclosure.com>

View File

@ -2089,6 +2089,14 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseProperty(
is_array_index = impl()->IsArrayIndex(prop_info->name, &index);
break;
}
case Token::BIGINT: {
Consume(Token::BIGINT);
prop_info->name = impl()->GetNumberAsSymbol();
is_array_index = impl()->IsArrayIndex(prop_info->name, &index);
break;
}
case Token::LBRACK: {
prop_info->name = impl()->NullIdentifier();
prop_info->is_computed_name = true;

View File

@ -0,0 +1,7 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var { 9007199254740991n: it } = { 9007199254740991n: 1 };
assertEquals(it, 1);