Skip to content

Commit 28735b0

Browse files
committed
Again, this is JS, not Python.
1 parent 48d63c6 commit 28735b0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

parse-css.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,10 +1327,10 @@ class AtRule extends CSSParserRule {
13271327
return s;
13281328
}
13291329
s += "{\n";
1330-
if(this.declarations) {
1330+
if(this.declarations.length) {
13311331
s += this.declarations.map(x=>x.toSource(indent+1)).join("\n") + "\n";
13321332
}
1333-
if(this.rules) {
1333+
if(this.rules.length) {
13341334
s += this.rules.map(x=>x.toSource(indent+1)).join("\n") + "\n";
13351335
}
13361336
s += printIndent(indent) + "}";
@@ -1357,15 +1357,11 @@ class QualifiedRule extends CSSParserRule {
13571357
toSource(indent=0) {
13581358
let s = printIndent(indent);
13591359
s += this.prelude.map(x=>x.toSource()).join("");
1360-
if(this.declarations == null) {
1361-
s += ";\n";
1362-
return s;
1363-
}
13641360
s += "{\n";
1365-
if(this.declarations) {
1361+
if(this.declarations.length;) {
13661362
s += this.declarations.map(x=>x.toSource(indent+1)).join("\n") + "\n";
13671363
}
1368-
if(this.rules) {
1364+
if(this.rules.length) {
13691365
s += this.rules.map(x=>x.toSource(indent+1)).join("\n") + "\n";
13701366
}
13711367
s += printIndent(indent) + "}";

0 commit comments

Comments
 (0)