mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Replaced .split("'").join("\\'") with .replace(/'/g, "\\'"). http://jsperf.com/split-join-vs-replace
This commit is contained in:
@@ -629,7 +629,7 @@
|
||||
var c = _.templateSettings;
|
||||
var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
|
||||
'with(obj||{}){__p.push(\'' +
|
||||
str.split("'").join("\\'")
|
||||
str.replace(/'/g, "\\'")
|
||||
.replace(c.interpolate, function(match, code) {
|
||||
return "'," + code.replace(/\\'/g, "'") + ",'";
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user