Transform labeled for-of inside braceless if statement (#12611)
This commit is contained in:
parent
eda4130d5e
commit
58d2f41930
@ -227,7 +227,9 @@ export default declare((api, options) => {
|
||||
container[0] = t.labeledStatement(parent.label, container[0]);
|
||||
|
||||
path.parentPath.replaceWithMultiple(nodes);
|
||||
path.remove();
|
||||
|
||||
// The parent has been replaced, prevent Babel from traversing a detatched path
|
||||
path.skip();
|
||||
} else {
|
||||
path.replaceWithMultiple(nodes);
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
if (true)
|
||||
actions: for (let x of y) {
|
||||
continue actions
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
if (true) {
|
||||
var _iterator = babelHelpers.createForOfIteratorHelper(y),
|
||||
_step;
|
||||
|
||||
try {
|
||||
actions: for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
let x = _step.value;
|
||||
continue actions;
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
if (true)
|
||||
actions: for (let x of y) {
|
||||
continue actions
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
if (true) {
|
||||
var _iterator = babelHelpers.createForOfIteratorHelper(y),
|
||||
_step;
|
||||
|
||||
try {
|
||||
actions: for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
let x = _step.value;
|
||||
continue actions;
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user