fix(angular): fix 5 compiler divergences from Angular reference#34
Merged
Brooooooklyn merged 1 commit intomainfrom Feb 24, 2026
Merged
fix(angular): fix 5 compiler divergences from Angular reference#34Brooooooklyn merged 1 commit intomainfrom
Brooooooklyn merged 1 commit intomainfrom
Conversation
1. (High) @let self-reference: mark name as declared AFTER transforming the declaration op, so self-references like `@let x = x + 1` are replaced with `undefined` — matching Angular's backward walk. 2. (Medium) @for invalid-shape recovery: return None when expression parsing fails or track is missing, matching Angular which returns null node instead of synthesizing a broken ForLoopBlock. 3. (Medium) @if invalid main-parameter recovery: only push the main branch (and @else if branches) when the expression parses successfully, matching Angular's conditional push. 4. (Medium) @switch invalid parameter count: parse the first parameter when present (even with extra params), only use empty binding when there are no parameters — matching Angular's createSwitchBlock. 5. (Low) Reify conditional contract: replace panic with OxcDiagnostic::error for missing processed expression, matching the StoreLet precedent in the same file and the project convention of diagnostics over panics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dbb49c4 to
d470ed7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
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.

(High) @let self-reference: mark name as declared AFTER transforming
the declaration op, so self-references like
@let x = x + 1arereplaced with
undefined— matching Angular's backward walk.(Medium) @for invalid-shape recovery: return None when expression
parsing fails or track is missing, matching Angular which returns
null node instead of synthesizing a broken ForLoopBlock.
(Medium) @if invalid main-parameter recovery: only push the main
branch (and @else if branches) when the expression parses
successfully, matching Angular's conditional push.
(Medium) @switch invalid parameter count: parse the first parameter
when present (even with extra params), only use empty binding when
there are no parameters — matching Angular's createSwitchBlock.
(Low) Reify conditional contract: replace panic with
OxcDiagnostic::error for missing processed expression, matching the
StoreLet precedent in the same file and the project convention of
diagnostics over panics.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Changes affect control-flow block AST emission and
@letreference rewriting, which can alter generated code and error-recovery behavior across templates. Risk is moderated by added conformance tests and diagnostics replacing panics.Overview
Aligns several template-compiler behaviors with Angular’s reference implementation, primarily around control-flow and error recovery.
@lethandling now treats the declaration op itself as not yet declared, so self-references like@let x = x + 1are rewritten toundefined(matching Angular’s backward walk). Control-flow transforms now skip emitting@fornodes when parameter parsing fails or whentrackis missing, skip pushing@if/@else ifbranches when the condition expression didn’t parse, and adjust@switchto always parse the first parameter when present even if extra params exist.Reify’s
Conditionalop no longer falls back totest/null; it emits a diagnostic and drops the stmt if the processed condition is missing. Adds/updates integration and R3-transform tests plus a snapshot to lock in the new conformance behavior.Written by Cursor Bugbot for commit d470ed7. This will update automatically on new commits. Configure here.