Skip to content

Resolve with-block properties child first inside each block params - #1216

Merged
jknack merged 1 commit into
jknack:masterfrom
ARAYN7011:fix/with-block-params-child-first
Nov 25, 2026
Merged

jknack merged 1 commit into
jknack:masterfrom
ARAYN7011:fix/with-block-params-child-first

Conversation

@ARAYN7011

Copy link
Copy Markdown

Fixes #1205.

Problem: inside a block that declares block params ({{#each x as |prop propName|}}), a nested {{#with ...}} used a parent-first lookup for every name, so the parent's typeName shadowed the with context's typeName (ParentType|ChildType instead of ChildType|ChildType).

Fix: the child context of a block-param context now only gives precedence to the (lexically scoped) block params themselves; all other names resolve child first like any other context.

Tests: new Issue1205 (3 cases: the report, block params still visible inside with, block param wins over a same-named child property). The first and second fail before the change and pass after. Full handlebars module tests pass (run with TZ=UTC; DateFormatTest fails on a half-hour-offset timezone independent of this change), spotless:check clean.

AI assistance: this change was prepared with Claude Code and reviewed/tested by me.

🤖 Generated with Claude Code

A with block nested in a block that declares block params used a
parent-first lookup for every name, so a property of the parent context
shadowed the same-named property of the with context. Only block params
(which are lexically scoped) now take precedence; everything else is
resolved child first.

Fixes jknack#1205

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@jknack jknack added the bug label Nov 25, 2026
@jknack jknack added this to the 4.5.9 milestone Nov 25, 2026
@jknack
jknack merged commit 496833f into jknack:master Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block parameters in each cause parent properties to shadow the current with context

2 participants