fallthrough should not execute case expression (#1683)

- de-duplicate trailing cases only, avoid all potential side-effects
- enable switch statement fuzzing

fixes #1680
This commit is contained in:
Alex Lam S.L
2017-03-26 16:52:38 +08:00
committed by GitHub
parent 5509e51098
commit 3276740779
3 changed files with 83 additions and 22 deletions

View File

@@ -201,7 +201,6 @@ function createStatement(recurmax, canThrow, canBreak, canContinue) {
case 6:
return createExpression(recurmax) + ';';
case 7:
return ';'; // TODO: disabled until some switch issues are resolved
// note: case args are actual expressions
// note: default does not _need_ to be last
return 'switch (' + createExpression(recurmax) + ') { ' + createSwitchParts(recurmax, 4) + '}';