The completion value of a switch case is incorrectly reset to undefined when a statement without a result (like a variable declaration) follows an expression statement. This will be fixed in the next commit.
3 lines
209 B
JavaScript
3 lines
209 B
JavaScript
console.log(eval("switch(1) { case 1: 'hello'; let x = 1; }"));
|
|
console.log(eval("switch(1) { case 1: 'first'; 'second'; }"));
|
|
console.log(eval("switch(1) { case 1: 'matched'; break; default: 'default'; }"));
|