fix(parser): comprehensive arrow function validation (25 tests)#187
Merged
fix(parser): comprehensive arrow function validation (25 tests)#187
Conversation
Add comprehensive arrow function validation to fix 25+ Test262 failures: - Super access: arrow functions now inherit allow_super_call and allow_super_property from enclosing method/constructor context - ASI restriction: enforce [no LineTerminator here] before => in the cover grammar path (after parseConditionalExpression) - Rest parameters: support ...rest in parenthesized expressions via parseExpressionOrRest for arrow function cover grammar - Non-simple params: detect destructuring/default/rest params and set has_simple_params=false so "use strict" body triggers SyntaxError - eval/arguments: check strict mode binding for single-identifier arrow params (both sync and async) - Duplicate params: add collectCoverParamNames that walks into destructuring patterns (object/array) to detect duplicates - Yield in params: detect yield expressions in arrow param defaults via checkCoverParamDefaultForYieldAwait - Await in async params: detect await identifiers in async arrow params via checkAsyncArrowParamsForAwait - Rest validation: check rest-init and trailing comma in cover grammar - Arrow param form: reject call_expression as arrow params via isValidArrowParamForm (fixes escaped-async and lineterminator) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ohah
added a commit
that referenced
this pull request
Mar 20, 2026
Re-apply PR #186 changes that conflicted with the already-merged PR #187: 1. checkIdentifierEscapedKeyword: skip kw_await/kw_yield (context-dependent) 2. Function declaration name parsed before enterFunctionContext (outer context) 3. Retroactive strict mode checks (checkStrictFunctionName, checkStrictParamNames) 4. BigInt property keys in parsePropertyKey 5. Yield expression terminators: add template_middle/template_tail 6. Object shorthand validation: non-identifier keys error 7. CoverInitializedName tracking in parseExpressionStatement 8. in_formal_parameters flag for yield/await expression checks 9. checkObjectDuplicateProto: skip shorthand properties Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ohah
added a commit
that referenced
this pull request
Mar 20, 2026
Re-apply PR #186 changes that conflicted with the already-merged PR #187: 1. checkIdentifierEscapedKeyword: skip kw_await/kw_yield (context-dependent) 2. Function declaration name parsed before enterFunctionContext (outer context) 3. Retroactive strict mode checks (checkStrictFunctionName, checkStrictParamNames) 4. BigInt property keys in parsePropertyKey 5. Yield expression terminators: add template_middle/template_tail 6. Object shorthand validation: non-identifier keys error 7. CoverInitializedName tracking in parseExpressionStatement 8. in_formal_parameters flag for yield/await expression checks 9. checkObjectDuplicateProto: skip shorthand properties Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Test plan
zig build test통과zig fmt --check src/통과🤖 Generated with Claude Code