mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Remove auto with statement removal optimization from _.template. [closes #166]
Former-commit-id: da27942b109844d44327914631b7c5681489b04b
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -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 }),
|
||||
|
||||
Reference in New Issue
Block a user