Don't mutate template AST in evaluate. Fixes #1143

This commit is contained in:
David Greenspan
2013-06-19 18:04:20 -07:00
parent e03ec98359
commit 972e295df6

View File

@@ -128,6 +128,7 @@ Handlebars.evaluate = function (ast, data, options) {
if (id[1] === '') {
// an empty path segment is our AST's way of encoding
// the presence of 'this.' at the beginning of the path.
id = id.slice();
id.splice(1, 1); // remove the ''
scopedToContext = true;
}