diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 27 | ||||
-rw-r--r-- | test/compress/reduce_vars.js | 8 |
2 files changed, 31 insertions, 4 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 745de9db..b68a04aa 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -4960,3 +4960,30 @@ issue_4171_2: { } expect_stdout: "undefined" } + +catch_defun: { + mangle = { + toplevel: true, + } + input: { + try { + throw 42; + } catch (a) { + function f() { + return typeof a; + } + } + console.log(f()); + } + expect: { + try { + throw 42; + } catch (o) { + function t() { + return typeof o; + } + } + console.log(t()); + } + expect_stdout: true +} diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index a79dd068..414d6646 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -5374,11 +5374,11 @@ defun_catch_4: { try { throw 42; } catch (a) { + function a() {} console.log(a); } } - expect_stdout: "42" - node_version: "<=4" + expect_stdout: true } defun_catch_5: { @@ -5400,10 +5400,10 @@ defun_catch_5: { throw 42; } catch (a) { console.log(a); + function a() {} } } - expect_stdout: "42" - node_version: "<=4" + expect_stdout: true } defun_catch_6: { |