diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/collapse_vars.js | 34 | ||||
-rw-r--r-- | test/reduce.js | 2 |
2 files changed, 35 insertions, 1 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 83eccdf1..d2f27299 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -9245,3 +9245,37 @@ issue_4935: { } expect_stdout: "1 0" } + +inline_throw: { + options = { + collapse_vars: true, + inline: true, + keep_fargs: false, + unused: true, + } + input: { + try { + (function() { + return function(a) { + return function(b) { + throw b; + }(a); + }; + })()("PASS"); + } catch (e) { + console.log(e); + } + } + expect: { + try { + (function(a) { + return function() { + throw a; + }(); + })("PASS"); + } catch (e) { + console.log(e); + } + } + expect_stdout: "PASS" +} diff --git a/test/reduce.js b/test/reduce.js index 3f154fa7..15f869e5 100644 --- a/test/reduce.js +++ b/test/reduce.js @@ -46,7 +46,7 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options) if (verbose) { log("// Node.js " + process.version + " on " + os.platform() + " " + os.arch()); } - if (differs.error && [ "DefaultsError", "SyntaxError" ].indexOf(differs.error.name) < 0) { + if (differs && differs.error && [ "DefaultsError", "SyntaxError" ].indexOf(differs.error.name) < 0) { test_for_diff = test_minify; differs = test_for_diff(testcase, minify_options, result_cache, max_timeout); } |