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) {
|
removeClass: function (el, name) {
|
||||||
|
el.className = L.Util.trim((' ' + el.className + ' ').replace(' ' + name + ' ', ' '));
|
||||||
function replaceFn(w, match) {
|
|
||||||
if (match === name) { return ''; }
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
el.className = el.className
|
|
||||||
.replace(/(\S+)\s*/g, replaceFn)
|
|
||||||
.replace(/(^\s+|\s+$)/, '');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setOpacity: function (el, value) {
|
setOpacity: function (el, value) {
|
||||||
|
@ -78,7 +78,7 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({
|
|||||||
if (options.dashArray) {
|
if (options.dashArray) {
|
||||||
stroke.dashStyle = options.dashArray instanceof Array ?
|
stroke.dashStyle = options.dashArray instanceof Array ?
|
||||||
options.dashArray.join(' ') :
|
options.dashArray.join(' ') :
|
||||||
options.dashArray.replace(/ *, */g, ' ');
|
options.dashArray.replace(/( *, *)/g, ' ');
|
||||||
} else {
|
} else {
|
||||||
stroke.dashStyle = '';
|
stroke.dashStyle = '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user