Skip to content

fix(angular): fix 3 control flow parity gaps with Angular reference#32

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/angular-control-flow-parity
Feb 24, 2026
Merged

fix(angular): fix 3 control flow parity gaps with Angular reference#32
Brooooooklyn merged 1 commit intomainfrom
fix/angular-control-flow-parity

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Feb 23, 2026

  • Fix empty parentheses in on-triggers (e.g. idle(), hover()) being
    incorrectly treated as having parameters. Angular's consumeParameters()
    returns zero parameters for empty parens.
  • Add viewport trigger parameter arity validation using top-level comma
    splitting to reject viewport(a,b) while accepting object literals
    like viewport({trigger: foo, rootMargin: "123px"}).
  • Fix @defer (on ) and @defer (when ) falling through to
    "Unrecognized trigger" error after lexer trimming. Now recognizes bare
    "on"/"when" keywords and matches Angular's silent acceptance.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Medium Risk
Changes affect control-flow parsing and error reporting for @defer triggers, so mismatches could alter accepted syntax or emitted diagnostics, but the scope is narrow and covered by new tests.

Overview
Improves @defer trigger parsing parity with Angular by treating empty parentheses like idle()/viewport() as no parameters, recognizing bare on/when keywords after trimming and silently accepting @defer (on ) / @defer (when ) instead of erroring.

Adds pre-parse arity validation for the viewport trigger using top-level comma splitting so viewport(a,b) errors while object-literal options containing nested commas are still accepted, and extends r3_template_transform_test.rs with focused regression coverage for these cases (plus a few error-recovery/cascade expectations).

Written by Cursor Bugbot for commit 221f499. This will update automatically on new commits. Configure here.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Brooooooklyn Brooooooklyn force-pushed the fix/angular-control-flow-parity branch from 8a3a1d5 to f3df656 Compare February 23, 2026 16:04
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

- Fix empty parentheses in on-triggers (e.g. `idle()`, `hover()`) being
  incorrectly treated as having parameters. Angular's consumeParameters()
  returns zero parameters for empty parens.
- Add viewport trigger parameter arity validation using top-level comma
  splitting to reject `viewport(a,b)` while accepting object literals
  like `viewport({trigger: foo, rootMargin: "123px"})`.
- Fix `@defer (on )` and `@defer (when )` falling through to
  "Unrecognized trigger" error after lexer trimming. Now recognizes bare
  "on"/"when" keywords and matches Angular's silent acceptance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-control-flow-parity branch from f3df656 to 221f499 Compare February 23, 2026 16:16
@Brooooooklyn Brooooooklyn merged commit 07eeb12 into main Feb 24, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-control-flow-parity branch February 24, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant