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 |
|
|
5 |
class WhileStatement extends Node { |
|
6 |
constructor(def) { |
|
7 |
super("WhileStatement"); |
4 only 2387.2 ✔ |
8 |
this.test = def.test;
|
4 only 2387.2 ✔ |
9 |
this.body = this.makeContainer(def.body); |
4 only 2387.2 ✔ |
10 |
} |
|
11 |
|
|
12 |
generateCode(codegen) { |
|
13 |
this.test = codegen.generateCode(this.test); |
4 only 2387.2 ✔ |
14 |
this.body = codegen.generateCode(this.body); |
4 only 2387.2 ✔ |
15 |
return this; |
4 only 2387.2 ✔ |
16 |
} |
|
17 |
|
|
18 |
writeCode(writer) { |
|
19 |
var test = this.test; |
4 only 2387.2 ✔ |
20 |
var body = this.body; |
4 only 2387.2 ✔ |
21 |
|
|
22 |
writer.write("while (");
|
4 only 2387.2 ✔ |
23 |
writer.write(test); |
4 only 2387.2 ✔ |
24 |
writer.write(") ");
|
4 only 2387.2 ✔ |
25 |
|
|
26 |
writer.write(body); |
4 only 2387.2 ✔ |
27 |
|
|
28 |
writer.write("\n");
|
4 only 2387.2 ✔ |
29 |
} |
|
30 |
|
|
31 |
walk(walker) { |
|
32 |
this.test = walker.walk(this.test); |
2 only 2387.2 ✔ |
33 |
this.body = walker.walk(this.body); |
2 only 2387.2 ✔ |
34 |
} |
|
35 |
} |
|
36 |
|
|
37 |
module.exports = WhileStatement; |
19 only 2387.2 ✔ |