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

This commit is contained in:
cloudhead 2010-03-19 17:56:43 -04:00
parent 215ef05907
commit f973deec28

View File

@ -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);