From 118cf2fc9ed40dc46ab9ac9fbe9b7fb87d624542 Mon Sep 17 00:00:00 2001 From: feng Date: Sat, 30 Jun 2012 22:50:34 +0800 Subject: [PATCH] fix global var leak --- mustache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mustache.js b/mustache.js index 42b0144..085d60b 100644 --- a/mustache.js +++ b/mustache.js @@ -433,7 +433,7 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {}; var lastToken; for (var i = 0; i < tokens.length; ++i) { - token = tokens[i]; + var token = tokens[i]; if (lastToken && lastToken.type === "text" && token.type === "text") { lastToken.value += token.value; @@ -452,7 +452,7 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {}; */ function parse(template, tags) { tags = tags || exports.tags; - tagRes = escapeTags(tags); + var tagRes = escapeTags(tags); var scanner = new Scanner(template);