From c804ed2ef163c16e9bf67d2f33fc7cdf966282dc Mon Sep 17 00:00:00 2001 From: cloudhead Date: Sat, 27 Feb 2010 14:13:28 -0500 Subject: [PATCH] simplified code-gen loop --- lib/less/node/ruleset.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/less/node/ruleset.js b/lib/less/node/ruleset.js index 3a0b3a5c..a46fde0b 100644 --- a/lib/less/node/ruleset.js +++ b/lib/less/node/ruleset.js @@ -16,21 +16,17 @@ node.Ruleset.prototype = { env.frames.unshift(this); for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof node.Ruleset) { continue } - - if (this.rules[i].toCSS) { - rules.push(this.rules[i].toCSS(env)); + if (this.rules[i] instanceof node.Ruleset) { + rulesets.push(this.rules[i].toCSS(path, env)); } else { - if (this.rules[i].value) { + if (this.rules[i].toCSS) { + rules.push(this.rules[i].toCSS(env)); + } else if (this.rules[i].value) { rules.push(this.rules[i].value.toString()); } } } - for (var i = 0; i < this.rules.length; i++) { - if (! (this.rules[i] instanceof node.Ruleset)) { continue } - rulesets.push(this.rules[i].toCSS(path, env)); - } if (rules.length > 0) { if (path.length > 0) { css.push(path.join('').trim(),