GraalJS doesn't branch to an empty case clause if there's a default specified. For example:
let value = 2;
switch(value){
default:
console.log("Default");
break;
case 1:
console.log("One");
break;
case 2:
}
In other JS engines, this script will (correctly) output nothing. In GraalJS, however, it prints "Default" as if case 2 didn't match. Note that adding a break statement changes this:
let value = 2;
switch(value){
default:
console.log("Default");
break;
case 1:
console.log("One");
break;
case 2:
+ break;
}
GraalJS doesn't branch to an empty
case
clause if there's adefault
specified. For example:In other JS engines, this script will (correctly) output nothing. In GraalJS, however, it prints "Default" as if
case 2
didn't match. Note that adding abreak
statement changes this: