add no loopParent warning to block scoping transformer
This commit is contained in:
@@ -454,6 +454,11 @@ LetScoping.prototype.buildHas = function (ret, call) {
|
||||
}
|
||||
|
||||
if (has.hasBreak || has.hasContinue) {
|
||||
if (!loopParent) {
|
||||
throw new Error("Has no loop parent but we're trying to reassign breaks " +
|
||||
"and continues, something is going wrong here.");
|
||||
}
|
||||
|
||||
// ensure that the parent has a label as we're building a switch and we
|
||||
// need to be able to access it
|
||||
var label = loopParent.label = loopParent.label || this.scope.generateUidIdentifier("loop");
|
||||
|
||||
Reference in New Issue
Block a user