From 5e7d75d6f63c94b84007f67ea34889616065b396 Mon Sep 17 00:00:00 2001 From: Andrea Zicchetti Date: Fri, 18 Nov 2011 17:12:53 +0100 Subject: [PATCH] Fixed a scope issue with the returned template function --- underscore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore.js b/underscore.js index 5579c07d3..f351721eb 100644 --- a/underscore.js +++ b/underscore.js @@ -915,7 +915,7 @@ .replace(/\t/g, '\\t') + "');}return __p.join('');"; var func = new Function('obj', '_', tmpl); - return data ? func(data, _) : function(data) { return func(data, _) }; + return data ? func(data, _) : function(data) { return func.call(this,data, _) }; }; // The OOP Wrapper