Skip to content

Commit 0bdafab

Browse files
committed
Give Declaration a proper toJSON that carries all of its info.
1 parent d201cb5 commit 0bdafab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

parse-css.js

+6
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,12 @@ function Declaration(name) {
12521252
}
12531253
Declaration.prototype = Object.create(CSSParserRule.prototype);
12541254
Declaration.prototype.type = "DECLARATION";
1255+
Declaration.prototype.toJSON = function() {
1256+
var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
1257+
json.name = this.name;
1258+
json.important = this.important;
1259+
return json;
1260+
}
12551261

12561262
function SimpleBlock(type) {
12571263
this.name = type;

0 commit comments

Comments
 (0)