[parser] Allow escaped future reserved keywords as identifiers

Bug: v8:11688
Change-Id: I35cf5d11d1a9af68be29c8e00224667ddbf07e7a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2864388
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74362}
This commit is contained in:
Shu-yu Guo 2021-04-30 15:30:58 -07:00 committed by V8 LUCI CQ
parent 2b69a1f049
commit 68c9af01f5
2 changed files with 6 additions and 9 deletions

View File

@ -4427,6 +4427,12 @@ bool ParserBase<Impl>::IsNextLetKeyword() {
case Token::ASYNC: case Token::ASYNC:
return true; return true;
case Token::FUTURE_STRICT_RESERVED_WORD: case Token::FUTURE_STRICT_RESERVED_WORD:
case Token::ESCAPED_STRICT_RESERVED_WORD:
// The early error rule for future reserved keywords
// (ES#sec-identifiers-static-semantics-early-errors) uses the static
// semantics StringValue of IdentifierName, which normalizes escape
// sequences. So, both escaped and unescaped future reserved keywords are
// allowed as identifiers in sloppy mode.
return is_sloppy(language_mode()); return is_sloppy(language_mode());
default: default:
return false; return false;

View File

@ -588,15 +588,6 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=11689 # https://bugs.chromium.org/p/v8/issues/detail?id=11689
'built-ins/BigInt/wrapper-object-ordinary-toprimitive': [FAIL], 'built-ins/BigInt/wrapper-object-ordinary-toprimitive': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=11688
'language/future-reserved-words/implements': [FAIL],
'language/future-reserved-words/interface': [FAIL],
'language/future-reserved-words/private': [FAIL],
'language/future-reserved-words/protected': [FAIL],
'language/future-reserved-words/public': [FAIL],
'language/future-reserved-words/package': [FAIL],
'language/future-reserved-words/static': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=11690 # https://bugs.chromium.org/p/v8/issues/detail?id=11690
'language/module-code/export-expname-binding-index': [FAIL], 'language/module-code/export-expname-binding-index': [FAIL],