diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-10 03:15:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-10 03:15:21 +0800 |
commit | 9e6b128374c62ee9f6238134fdc207ec9dc86284 (patch) | |
tree | 2baea0b4a78af05f080ef389e7b58f0c6c957479 /test/compress | |
parent | 93cdb194f4895384b68a66736366659c39caece8 (diff) | |
download | tracifyjs-9e6b128374c62ee9f6238134fdc207ec9dc86284.tar.gz tracifyjs-9e6b128374c62ee9f6238134fdc207ec9dc86284.zip |
fix catch variable reference in IE8 (#1587)
`AST_Scope.def_variable()` will overwrite `AST_Symbol.thedef`, so save a copy before calling.
fixes #1586
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/screw-ie8.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/compress/screw-ie8.js b/test/compress/screw-ie8.js index 36eb4d3a..4fbb95c8 100644 --- a/test/compress/screw-ie8.js +++ b/test/compress/screw-ie8.js @@ -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)}}" +} |