Add tests for escaped contextual keywords as class field names - #5134
Open
magic-akari wants to merge 4 commits into
Open
magic-akari wants to merge 4 commits into
magic-akari wants to merge 4 commits into
Conversation
|
104 new or modified tests were run on 7 engines. Test results
|
magic-akari
marked this pull request as ready for review
September 13, 2026 16:07
Extend the escaped class field tests to cover accessor with explicit semicolons, initializers, and ASI before subsequent class elements and the closing brace. Cover instance and static fields in both class declarations and class expressions. These tests exercise ordinary field names and do not require decorators support.
Verify that escaped get, set, static, and async field names cannot be followed by a method on the same line without a semicolon. Cover instance and static fields in both class declarations and class expressions. Add decorators tests rejecting escaped accessor modifiers for instance and static auto-accessors.
hubot
pushed a commit
to v8/v8
that referenced
this pull request
Sep 16, 2026
Treat escaped `get`/`set` spellings as property names instead of rejecting them as escaped accessor keywords. This allows automatic semicolon insertion when another class member follows on a new line. Add a regression test covering both instance and static fields. Related tests: tc39/test262#5134 Change-Id: I7551557758383a5100def79f3041efbb26f7cd59 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8403169 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/main@{#109877}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Escaped spellings of
get,set,static, andasyncare valid class field names. This adds coverage for instance and static fields, explicit semicolons, initializers, and ASI before subsequent class elements and the closing brace.Each ASI case isolates one boundary. Existing templates generate both class declarations and class expressions, with assertions checking field placement and relevant runtime behavior.
Specification:
Related implementation fix: