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 |
var parseFor = require("./parseFor"); |
2 only 2387.2 ✔ |
2 |
|
|
3 |
function createLoopNode(str, body, builder) { |
|
4 |
var forDef = parseFor(str);
|
308 only 2387.2 ✔ |
5 |
|
|
6 |
forDef.body = body; |
294 only 2387.2 ✔ |
7 |
|
|
8 |
if (forDef.loopType === "ForEach") { |
|
9 |
return builder.forEach(forDef);
|
241 only 2387.2 ✔ |
10 |
} else if (forDef.loopType === "ForRange") { |
|
11 |
return builder.forRange(forDef);
|
16 only 2387.2 ✔ |
12 |
} else if (forDef.loopType === "ForEachProp") { |
|
13 |
return builder.forEachProp(forDef);
|
26 only 2387.2 ✔ |
14 |
} else if (forDef.loopType === "For") { |
|
15 |
return builder.forStatement(forDef);
|
11 only 2387.2 ✔ |
16 |
} else {
|
|
17 |
throw new Error("Unsupported loop type: " + forDef.loopType); |
× |
18 |
} |
|
19 |
} |
|
20 |
|
|
21 |
module.exports = createLoopNode; |
2 only 2387.2 ✔ |