1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var Atrule = require('./atrule');
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | var Supports = module.exports = function Supports(condition){
|
21 | Atrule.call(this, 'supports');
|
22 | this.condition = condition;
|
23 | };
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | Supports.prototype.__proto__ = Atrule.prototype;
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | Supports.prototype.clone = function(parent){
|
39 | var clone = new Supports;
|
40 | clone.condition = this.condition.clone(parent, clone);
|
41 | clone.block = this.block.clone(parent, clone);
|
42 | clone.lineno = this.lineno;
|
43 | clone.column = this.column;
|
44 | clone.filename = this.filename;
|
45 | return clone;
|
46 | };
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | Supports.prototype.toJSON = function(){
|
56 | return {
|
57 | __type: 'Supports',
|
58 | condition: this.condition,
|
59 | block: this.block,
|
60 | lineno: this.lineno,
|
61 | column: this.column,
|
62 | filename: this.filename
|
63 | };
|
64 | };
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | Supports.prototype.toString = function(){
|
74 | return '@supports ' + this.condition;
|
75 | };
|