Enforce 100% code coverage
This commit is contained in:
@@ -90,7 +90,8 @@ CodeGen.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
empty: function(loc = this.currentLocation || {start: {}}) {
|
||||
empty: function() {
|
||||
let loc = this.currentLocation || {start: {}};
|
||||
return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
|
||||
},
|
||||
wrap: function(chunk, loc = this.currentLocation || {start: {}}) {
|
||||
@@ -137,22 +138,22 @@ CodeGen.prototype = {
|
||||
},
|
||||
|
||||
|
||||
generateList: function(entries, loc) {
|
||||
let ret = this.empty(loc);
|
||||
generateList: function(entries) {
|
||||
let ret = this.empty();
|
||||
|
||||
for (let i = 0, len = entries.length; i < len; i++) {
|
||||
if (i) {
|
||||
ret.add(',');
|
||||
}
|
||||
|
||||
ret.add(castChunk(entries[i], this, loc));
|
||||
ret.add(castChunk(entries[i], this));
|
||||
}
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
generateArray: function(entries, loc) {
|
||||
let ret = this.generateList(entries, loc);
|
||||
generateArray: function(entries) {
|
||||
let ret = this.generateList(entries);
|
||||
ret.prepend('[');
|
||||
ret.add(']');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user