fix catch variable reference in IE8 (#1587)

`AST_Scope.def_variable()` will overwrite `AST_Symbol.thedef`, so save a copy before calling.

fixes #1586
This commit is contained in:
Alex Lam S.L
2017-03-10 03:15:21 +08:00
committed by GitHub
parent 93cdb194f4
commit 9e6b128374
2 changed files with 38 additions and 1 deletions

View File

@@ -182,3 +182,39 @@ reduce_vars: {
}
}
}
issue_1586_1: {
options = {
screw_ie8: false,
}
mangle = {
screw_ie8: false,
}
input: {
function f() {
try {
} catch (err) {
console.log(err.message);
}
}
}
expect_exact: "function f(){try{}catch(c){console.log(c.message)}}"
}
issue_1586_2: {
options = {
screw_ie8: true,
}
mangle = {
screw_ie8: true,
}
input: {
function f() {
try {
} catch (err) {
console.log(err.message);
}
}
}
expect_exact: "function f(){try{}catch(c){console.log(c.message)}}"
}