Skip to content

Commit eceefe1

Browse files
committed
fixup: labels
1 parent ab74044 commit eceefe1

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
@@ -262,6 +262,19 @@ describe('AsyncWriter', function () {
262262
runTranspiledCode('switch (1) { case 1: 1; break; case 2: 2; break;}')
263263
).to.equal(1);
264264
});
265+
266+
it('does supports labeled break/switch', function () {
267+
expect(
268+
runTranspiledCode(`
269+
let i,j;
270+
label1: for (i = 0;; i++) {
271+
label2: for (j = 0; j < 2; j++) {
272+
if (i++ === 0) continue label2;
273+
};
274+
if (i++ > 20) break label1;
275+
}; i`)
276+
).to.equal(23);
277+
});
265278
});
266279

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

0 commit comments

Comments
 (0)