refactored rule() cause the closure slows things down too much for some reason

nohash
cloudhead 15 years ago
parent 215ef05907
commit f973deec28

@ -657,17 +657,17 @@ less.parser = {
}
},
rule: function () {
var value;
if (name = $(this.property) || $(this.variable)) {
value = (function (that) {
if ((name[0] != '@') && (match = peek(/([^@+\/*(;{}-]*);/g))) {
i += match[0].length - 1;
return match[1];
} else if (name === "font") {
return $(that.font);
} else {
return $(that.value);
}
})(this);
if ((name[0] != '@') && (match = peek(/([^@+\/*(;{}-]*);/g))) {
i += match[0].length - 1;
value = match[1];
} else if (name === "font") {
value = $(this.font);
} else {
value = $(this.value);
}
if ($(this.end)) {
return new(tree.Rule)(name, value);

Loading…
Cancel
Save