Skip to content

partial parameters are lower on the stack than context #313

@carchrae

Description

@carchrae

When giving a partial parameters, they are pushed down the stack and the previous context is pushed onto head. If there are two variables with the same name, then the partial parameter will be hidden by the higher context.

This is confusing default behaviour and seems inconsistent to how sections operate.

I'm aware of the changes introduced by #132 - but this seems like a hack to fix the issue of not searching a higher context ( #271 ).

See example below. Expect x=2, but it is x=1.

dust.loadSource(dust.compile("partial says x={x}", "part"));
dust.loadSource(dust.compile("{>part x=\"2\" /}", "test"));
var data = {
  x :1
};

dust.render("test", data, function(err, out) {
  $("body").html(out);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions