mustache
mustache copied to clipboard
Stack overflow on recursion
Following test throws stack overflow exception.
test('recursion', () {
var output = _partialTest({
'content': "X",
'nodes': [
{'content': "Y", 'nodes': [
{'content': "Y1"},
{'content': "Y2"},
]}
]
}, {
'root': '{{>node}}',
'node': '{{content}}<{{#nodes}}{{>node}}{{/nodes}}>'
}, 'root', lenient: true);
expect(output, equals('X<Y<Y1Y2>>'));
});