travis-ci
4670 of 5656 branches covered (82.57%)
13 of 13 new or added lines in 2 files covered. (100.0%)
10412 of 11525 relevant lines covered (90.34%)
5850.54 hits per line
1 |
"use strict";
|
|
2 |
|
|
3 |
var Node = require("./Node"); |
19 only 2387.2 ✔ |
4 |
var ok = require("assert").ok; |
19 only 2387.2 ✔ |
5 |
|
|
6 |
class Expression extends Node { |
|
7 |
constructor(def) { |
|
8 |
super("Expression"); |
703 only 2387.2 ✔ |
9 |
this.value = def.value;
|
703 only 2387.2 ✔ |
10 |
ok(this.value != null, "Invalid expression"); |
703 only 2387.2 ✔ |
11 |
} |
|
12 |
|
|
13 |
generateCode() { |
|
14 |
return this; |
703 only 2387.2 ✔ |
15 |
} |
|
16 |
|
|
17 |
writeCode(writer) { |
|
18 |
writer.write(this.value);
|
701 only 2387.2 ✔ |
19 |
} |
|
20 |
|
|
21 |
isCompoundExpression() { |
|
22 |
return true; |
× |
23 |
} |
|
24 |
|
|
25 |
toString() { |
|
26 |
return this.value; |
× |
27 |
} |
|
28 |
} |
|
29 |
|
|
30 |
module.exports = Expression; |
19 only 2387.2 ✔ |