Repository navigation
fix: accept undefined as a statement label - #71
Merged
Merged
Conversation
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.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.
Why
undefined: while (true) { break undefined; }is valid JavaScript, but released 2.0.1 reports an error at the label. The lexer selects the existing namedundefinedtoken, which the label rule does not accept. This is an uncovered identifier-consumer case related to issue #51; merged #62 repaired arrow parameters and compound assignments.Requirements
Customer Summary
Labels named
undefinedparse correctly, including labeled loops, break/continue targets, comments before the colon and escaped spellings.Technical Summary
The existing label-name choice accepts
undefinedthrough itsstatement_identifieralias. Public node metadata, scanner code, external tokens and query files are unchanged. Generation adds two states, 3,726 bytes of C and 336 bytes of Wasm (0.042%).Testing
Notes
The grammar's existing
undefinedexpression node remains distinct from label identifiers. This change does not address the separate function-context, legacy call-target or artifact-size issues #55/#58/#59. The public API regression compares syntax and query output rather than executing supplied JavaScript. Nine local warmed CPU samples on 1,500 retained ordinary labeled functions measured medians of 18.3 ms before and 19.5 ms after; the repaired-label workload fell from 44.2 ms with recovery to 10.7 ms. These variable local measurements do not establish a general speed guarantee.