Open
Description
The bug can be reproduced in ch version 1.11.15.0.
Running following code:
let temp = eval('42;switch (0) { case 0: break; };');
console.log(temp);
Actual results:
42
Expected results:
undefined
According to ecma manual,https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation, the value of a StatementList is the value of the last value producing item in the StatementList. Switch statement produce value undefined (https://tc39.es/ecma262/#sec-runtime-semantics-caseblockevaluation), so the result should be undefined.
ISec Lab
2019.12.26