simplified code-gen loop

This commit is contained in:
cloudhead
2010-02-27 14:13:28 -05:00
parent 5a1adf801a
commit c804ed2ef1

View File

@@ -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(),