Remove auto with statement removal optimization from _.template. [closes #166]

Former-commit-id: da27942b109844d44327914631b7c5681489b04b
This commit is contained in:
John-David Dalton
2013-01-24 00:44:08 -08:00
parent 4c83435b4b
commit 641b6efe7f
7 changed files with 202 additions and 205 deletions

View File

@@ -2090,6 +2090,16 @@
equal(compiled(data), 'a');
});
test('should work with "interpolate" delimiters containing global values', function() {
var compiled = _.template('<%= typeof QUnit.init %>');
try {
var actual = compiled();
} catch(e) { }
equal(actual, 'function');
});
test('should parse delimiters with newlines', function() {
var expected = '<<\nprint("<p>" + (value ? "yes" : "no") + "</p>")\n>>',
compiled = _.template(expected, null, { 'evaluate': /<<(.+?)>>/g }),