Skip to content

Commit c3b1d51

Browse files
committed
fixup: labels
1 parent 49e0cc4 commit c3b1d51

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/async-rewriter2/src/async-writer-babel.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,19 @@ describe('AsyncWriter', function () {
275275
runTranspiledCode('switch (1) { case 1: 1; break; case 2: 2; break;}')
276276
).to.equal(1);
277277
});
278+
279+
it('does supports labeled break/switch', function () {
280+
expect(
281+
runTranspiledCode(`
282+
let i,j;
283+
label1: for (i = 0;; i++) {
284+
label2: for (j = 0; j < 2; j++) {
285+
if (i++ === 0) continue label2;
286+
};
287+
if (i++ > 20) break label1;
288+
}; i`)
289+
).to.equal(23);
290+
});
278291
});
279292

280293
context('implicit awaiting', function () {

0 commit comments

Comments
 (0)