optimize try-catch-finally (#1731)

- eliminate empty blocks
- flatten out if try-block does not throw
This commit is contained in:
Alex Lam S.L
2017-03-30 12:16:58 +08:00
committed by GitHub
parent 0f910ee25c
commit 7bea38a05d
5 changed files with 81 additions and 12 deletions

View File

@@ -70,6 +70,7 @@ side_effects_finally: {
function f() {
function g() {
try {
x();
} catch (e) {
} finally {
console.log("PASS");
@@ -83,6 +84,7 @@ side_effects_finally: {
function f() {
(function() {
try {
x();
} catch (e) {
} finally {
console.log("PASS");