Permalink
Browse files

Merge pull request #374 from azicchetti/master

Fixing a scope issue of the function returned by template()
  • Loading branch information...
2 parents 8c34614 + 5e7d75d commit aafc832a7789947087c046ed3d15e14ef99c06a9 @jashkenas committed Nov 18, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 underscore.js
View
2 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

0 comments on commit aafc832

Please sign in to comment.