[parser] Support BigIntLiteral in visitMemberKey - #560
Open
CSharperMantle wants to merge 1 commit into
Open
CSharperMantle wants to merge 1 commit into
CSharperMantle wants to merge 1 commit into
Conversation
CSharperMantle
added a commit
to CSharperMantle/googleprojectzero-fuzzilli
that referenced
this pull request
Sep 15, 2026
This enables parsing of BigIntLiteral-keyed properties, methods, and
destructuring bindings, for example:
({1n: 0});
class C { 1n(){} }
for (const {1n: x} of [{}]) {}
Link: googleprojectzero#560
Liedtke
reviewed
Sep 15, 2026
| } else if (member.key.type === 'StringLiteral') { | ||
| body.name = member.key.value; | ||
| } else if (member.key.type === 'BigIntLiteral') { | ||
| body.name = member.key.value; |
Collaborator
There was a problem hiding this comment.
Looks like a nice and trivial fix, could you be so kind and maybe add a small test case (or extend an existing one) to CompilerTests that covers this branch and ensures the "roundtrip" works correctly?
Contributor
Author
There was a problem hiding this comment.
Okay, I'll look into it tomorrow morning local time :)
CSharperMantle
force-pushed
the
fix-parserjs-bigintlit-key
branch
from
September 16, 2026 02:15
fd2cce4 to
1cc4f6c
Compare
This enables parsing of BigIntLiteral-keyed properties, methods, and
destructuring bindings, for example:
({1n: 0});
class C { 1n(){} }
for (const {1n: x} of [{}]) {}
CSharperMantle
force-pushed
the
fix-parserjs-bigintlit-key
branch
from
September 16, 2026 02:19
1cc4f6c to
91cd655
Compare
CSharperMantle
added a commit
to CSharperMantle/googleprojectzero-fuzzilli
that referenced
this pull request
Sep 16, 2026
This enables parsing of BigIntLiteral-keyed properties, methods, and
destructuring bindings, for example:
({1n: 0});
class C { 1n(){} }
for (const {1n: x} of [{}]) {}
Link: googleprojectzero#560
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.
Currently, when trying to parse the following program using parser.js:
... this exception is thrown:
Similar
BigInt-keyed patterns are also found in SpiderMonkey's js/src/jit-test/tests/1659595.js.visitExpressionin parser.js already handles theBigIntLiteraltype; thus, fix up thevisitMemberKeyhandling similarly.fuzzilli/Sources/Fuzzilli/Compiler/Parser/parser.js
Lines 618 to 620 in e2f6fa7
This fix would enable correct parsing of all three patterns mentioned above.