mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Ensure _.template supports single line comments in "evaluate" delimiters in minified builds. [closes #361]
This commit is contained in:
@@ -3975,12 +3975,17 @@
|
||||
strictEqual(compiled({}), '1');
|
||||
});
|
||||
|
||||
test('should coerce `text` argument to a string', function() {
|
||||
test('should coerce `text` argument to a string', 1, function() {
|
||||
var data = { 'a': 1 },
|
||||
object = { 'toString': function() { return '<%= a %>'; } };
|
||||
|
||||
strictEqual(_.template(object, data), '1');
|
||||
});
|
||||
|
||||
test('should support single line comments in "evaluate" delimiters (test production builds)', 1, function() {
|
||||
var compiled = _.template('<% // comment %><% if (value) { %>yap<% } else { %>nope<% } %>');
|
||||
equal(compiled({ 'value': true }), 'yap');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user