Skip to content

fix: support hash arguments for inline partials - #647

Merged
rexm merged 1 commit into
masterfrom
fix/issue-560
Aug 5, 2026
Merged

fix: support hash arguments for inline partials#647
rexm merged 1 commit into
masterfrom
fix/issue-560

Conversation

@rexm

@rexm rexm commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • {{#*inline "name" ...}} decorator required exactly 1 argument, so passing hash arguments (or any extra positional arg) threw HandlebarsRuntimeException. Relaxed the check to only require the partial name argument, ignoring extras — matching Handlebars.js's own inline decorator behavior.
  • Hash arguments at the invocation site ({{> myPartial key=value}}) already worked identically for inline and registered partials; that path was unaffected.

Test plan

  • Added regression tests in InlinePartialTests.cs covering the issue's exact repro plus a hash-argument variant
  • Full test suite passes (1840/1840)

Fixes #560

🤖 Generated with Claude Code

InlineBlockDecoratorDescriptor required the {{#*inline "name"}} decorator
to receive exactly one argument, so passing any extra positional or hash
argument on the inline definition (e.g. {{#*inline "name" arg}}) threw at
runtime. Relax the check to only require the partial name, matching
Handlebars.js which uses args[0] for the name and ignores the rest.

Hash arguments passed when invoking an inline partial (e.g.
{{> myPartial key=value}}) already worked via the shared PartialBinder
context-creation path used by both inline and registered partials.
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@rexm
rexm merged commit 18dac20 into master Aug 5, 2026
7 checks passed
@rexm
rexm deleted the fix/issue-560 branch August 5, 2026 03:26
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.

Hash arguments for inline paritals

1 participant