Modify or replace regexes that break javascript lazy evaluation with multi line comments
This commit is contained in:
parent
904bf581dd
commit
dc07a68ed0
@ -130,15 +130,7 @@ L.DomUtil = {
|
||||
},
|
||||
|
||||
removeClass: function (el, name) {
|
||||
|
||||
function replaceFn(w, match) {
|
||||
if (match === name) { return ''; }
|
||||
return w;
|
||||
}
|
||||
|
||||
el.className = el.className
|
||||
.replace(/(\S+)\s*/g, replaceFn)
|
||||
.replace(/(^\s+|\s+$)/, '');
|
||||
el.className = L.Util.trim((' ' + el.className + ' ').replace(' ' + name + ' ', ' '));
|
||||
},
|
||||
|
||||
setOpacity: function (el, value) {
|
||||
|
@ -78,7 +78,7 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({
|
||||
if (options.dashArray) {
|
||||
stroke.dashStyle = options.dashArray instanceof Array ?
|
||||
options.dashArray.join(' ') :
|
||||
options.dashArray.replace(/ *, */g, ' ');
|
||||
options.dashArray.replace(/( *, *)/g, ' ');
|
||||
} else {
|
||||
stroke.dashStyle = '';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user