Skip to content

fix: named args in partial work in nested #each (issue #455)#630

Merged
rexm merged 3 commits into
masterfrom
worktree-agent-aa8b1dc5979b3e375
Jun 20, 2026
Merged

fix: named args in partial work in nested #each (issue #455)#630
rexm merged 3 commits into
masterfrom
worktree-agent-aa8b1dc5979b3e375

Conversation

@rexm

@rexm rexm commented Jun 20, 2026

Copy link
Copy Markdown
Member

Fixes #455

Summary

  • Named partial hash parameters ({{> myPartial arg1=value1 arg2=value2}}) inside a nested {{#each}} loop were reported to throw ArgumentOutOfRangeException.
  • Investigation found that the existing fix for issue Potential issue calling a partial with a partial parameter inside of an #each block #422 (BindingContext.PopulateHash guarding against ObjectDescriptor.Empty) already covers the nested #each case as well.
  • This PR adds a regression test in source/Handlebars.Test/Issues/Issue455Tests.cs to explicitly document and lock in this behavior.

Test plan

Partial hash parameters no longer throw ArgumentOutOfRangeException when used inside a nested #each loop.

🤖 Generated with Claude Code

rexm and others added 2 commits June 20, 2026 08:24
…ch (issue #455)

Verifies that {{> myPartial arg1=value1 arg2=value2}} works correctly inside
a nested {{#each}} loop without throwing ArgumentOutOfRangeException. The
existing #422 fix in BindingContext.PopulateHash already covers this case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rexm rexm enabled auto-merge June 20, 2026 12:57
@sonarqubecloud

Copy link
Copy Markdown

@rexm rexm merged commit 3dfe95a into master Jun 20, 2026
7 checks passed
@rexm rexm deleted the worktree-agent-aa8b1dc5979b3e375 branch June 20, 2026 21:10
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.

Using named arguments in partials in nested loop causes error

1 participant