diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/hoist_vars.js | 29 | ||||
-rw-r--r-- | test/ufuzz/index.js | 4 |
2 files changed, 30 insertions, 3 deletions
diff --git a/test/compress/hoist_vars.js b/test/compress/hoist_vars.js index 8db060df..a6efa7af 100644 --- a/test/compress/hoist_vars.js +++ b/test/compress/hoist_vars.js @@ -265,3 +265,32 @@ issue_4839: { } expect_stdout: "PASS" } + +issue_4859: { + options = { + evaluate: true, + hoist_vars: true, + keep_infinity: true, + merge_vars: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f(a) { + var b = (a = 2, 1 / 0), c = 3; + var d = a + b; + console.log(d); + return f; + } + f(); + } + expect: { + (function f(a) { + var d = 1 / 0, d = Infinity; + console.log(d); + return f; + })(); + } + expect_stdout: "Infinity" +} diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index 5a791f19..69760b22 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -1796,11 +1796,9 @@ function createClassLiteral(recurmax, stmtDepth, canThrow, name) { if (SUPPORT.class_field && rng(2)) { s += internal || createObjectKey(recurmax, stmtDepth, canThrow); if (rng(5)) { - async = false; + async = bug_async_class_await && fixed; generator = false; - if (bug_async_class_await && fixed) addAvoidVar("await"); s += " = " + createExpression(recurmax, NO_COMMA, stmtDepth, fixed ? canThrow : CANNOT_THROW); - if (bug_async_class_await && fixed) removeAvoidVar("await"); generator = save_generator; async = save_async; } |