add auxiliary comment to let scoping closure flow control - fixes #819
This commit is contained in:
@@ -546,14 +546,16 @@ BlockScoping.prototype.buildHas = function (ret, call) {
|
||||
|
||||
if (cases.length === 1) {
|
||||
var single = cases[0];
|
||||
body.push(t.ifStatement(
|
||||
body.push(this.file.attachAuxiliaryComment(t.ifStatement(
|
||||
t.binaryExpression("===", ret, single.test),
|
||||
single.consequent[0]
|
||||
));
|
||||
)));
|
||||
} else {
|
||||
body.push(t.switchStatement(ret, cases));
|
||||
body.push(this.file.attachAuxiliaryComment(t.switchStatement(ret, cases)));
|
||||
}
|
||||
} else {
|
||||
if (has.hasReturn) body.push(retCheck);
|
||||
if (has.hasReturn) {
|
||||
body.push(this.file.attachAuxiliaryComment(retCheck));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user