mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Replacing replace's options to flags
This commit is contained in:
@@ -218,10 +218,10 @@ tree.functions = {
|
||||
escape: function (str) {
|
||||
return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
|
||||
},
|
||||
replace: function (subject, pattern, replacement, options) {
|
||||
replace: function (subject, pattern, replacement, flags) {
|
||||
var str = subject.value;
|
||||
|
||||
str = str.replace(new RegExp(pattern.value, options ? options.value : ""), replacement.value);
|
||||
str = str.replace(new RegExp(pattern.value, flags ? flags.value : ""), replacement.value);
|
||||
|
||||
return new(tree.Quoted)('"' + str + '"', str);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user