mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
20 lines
266 B
JavaScript
20 lines
266 B
JavaScript
function* gen(type) {
|
|
switch (type) {
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
expect(gen(1).next().done).toBe(true);
|
|
|
|
function* gen2(type) {
|
|
switch (type) {
|
|
case 0:
|
|
throw "unreachable";
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
expect(gen2(1).next().done).toBe(true);
|