Tan Li Hau 3e4a9d588b Do expressions transform for switch statements (#10070)
* lint fix

* switch inside do expression

* review comments

* review comments

* make min diff

* adding more test

* review changes

* review changes

* handle block statement and added more test cases

* fix implementation and add more test cases

* fix last swtich case

* disable block fallthrough case

* fix nitpick reviews
2019-08-01 09:36:35 +02:00

35 lines
414 B
JavaScript

const x = n => function () {
switch (n) {
case 0:
{
get();
return 'a';
}
case 1:
{
return 'b';
'c';
break;
'd';
}
case 2:
{
'e';
const a = 'e';
return void 0;
}
case 3:
{
const a = 'f';
return void 0;
'f';
}
default:
return 'g';
}
}();