Skip to content

Calling method within Twig file with two parameters results in a compiled twig template calling with four parameters #31

Description

@dane-harnett

I am passing an object into my template like such

var obj = { value: 'a', doStuff: function(param1, param2) { ...}};

Twig.render(myTemplate.twig, {
data: obj
});

{{ data.doStuff('a', 'b') }}

when doing this, the compiled template ends up calling doStuff() with four params like this: [0, 'a', 1, 'b']

Causing the function to fail as the parameters are not as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions