From f973deec28745a511aceea4184520d1e49beae4b Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 19 Mar 2010 17:56:43 -0400 Subject: [PATCH] refactored rule() cause the closure slows things down too much for some reason --- lib/less/parser.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index 9276f39..87b43ab 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -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);