Skip to content

Regression: Partial parameter context isolation (issue #495) no longer working #693

@Repo-SK

Description

@Repo-SK

Issue #495 fixed partial parameter context isolation by ensuring that when parameters are passed to a partial, the parent context doesn't leak through. This has regressed in recent versions.

For example:

{{~#*inline "displayName"~}}
Template:{{name}}
{{/inline}}

{{#each data as |name|}}
Name:{{name}}
{{>displayName name="aaaa"}}
{{/each}}

with data:

{
  "data": ["hudel", "test"]
}

should output:

Name:hudel
Template:aaaa
Name:test
Template:aaaa

but currently outputs:

Name:hudel
Template:hudel
Name:test
Template:test

The parent context's name is leaking into the partial despite explicitly passing name="aaaa".
The regression appears to be related to changes in block context handling in partial.rs.

The current unit test for this issue (test_partial_context_issue_495) is incorrect - it tests context inheritance rather than context isolation.

Original fix: #495
Current incorrect test:

fn test_partial_context_issue_495() {

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions