From 972e295df6f73abf47740e689a69e0486934b47a Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Wed, 19 Jun 2013 18:04:20 -0700 Subject: [PATCH] Don't mutate template AST in evaluate. Fixes #1143 --- packages/handlebars/evaluate.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/handlebars/evaluate.js b/packages/handlebars/evaluate.js index 31403fd1a7..fa3df9bcd2 100644 --- a/packages/handlebars/evaluate.js +++ b/packages/handlebars/evaluate.js @@ -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; }