fix(angular): fix 3 compiler divergences from Angular reference#33
Merged
Brooooooklyn merged 1 commit intomainfrom Feb 24, 2026
Merged
Conversation
1. (High) Remove incorrect bare property track optimization: Angular does
NOT optimize `track id` or `track trackByFn` into direct `ctx.id`
references. Only `$index`, `$item`, and `fn($index[, $item])` calls
are optimized. Bare property reads now correctly generate wrapper
functions like `function _forTrack($index,$item) { return this.id; }`.
2. (Medium) Report diagnostic for missing context in resolve_contexts:
Angular throws when a ContextExpr references a view with no scope
entry. Now reports an OxcDiagnostic error via job.diagnostics instead
of silently keeping the unresolved expression.
3. (Low) Report diagnostic for unknown @for loop variables in ingest:
Angular throws an assertion for unknown loop variables. Now reports
an OxcDiagnostic error instead of silently returning an empty
expression.
Co-Authored-By: Claude Opus 4.6 <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.

(High) Remove incorrect bare property track optimization: Angular does
NOT optimize
track idortrack trackByFninto directctx.idreferences. Only
$index,$item, andfn($index[, $item])callsare optimized. Bare property reads now correctly generate wrapper
functions like
function _forTrack($index,$item) { return this.id; }.(Medium) Report diagnostic for missing context in resolve_contexts:
Angular throws when a ContextExpr references a view with no scope
entry. Now reports an OxcDiagnostic error via job.diagnostics instead
of silently keeping the unresolved expression.
(Low) Report diagnostic for unknown @for loop variables in ingest:
Angular throws an assertion for unknown loop variables. Now reports
an OxcDiagnostic error instead of silently returning an empty
expression.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Changes affect template codegen for
@for trackexpressions and add new compilation errors for previously silent edge cases, which may alter output and error behavior for some templates.Overview
Stops optimizing bare
@for ...; track id/track trackByFnproperty reads into directctx.*references, so these now fall back to the non-optimizable path that generates a wrapper track function (matching Angular runtime semantics).Adds new error diagnostics instead of silently producing empty/unresolved expressions: unknown
@forloop variables now push anOxcDiagnosticduring ingestion, and missing context mappings inresolve_contextsnow record errors (collected viaRefCell) and append them tojob.diagnosticsfor both component and host compilation.Adds integration tests + snapshots covering the bare-property/bare-method
trackcases to prevent regression.Written by Cursor Bugbot for commit 9922fe1. This will update automatically on new commits. Configure here.