diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-21 06:33:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 14:33:31 +0800 |
commit | e675262d51103122720aded924f5571e12086fc9 (patch) | |
tree | 517855b5eb23c0850c97e0fafa158747befb11ee /test/ufuzz/index.js | |
parent | c1e771a89a65751016bbafd56d710accf6d7bf21 (diff) | |
download | tracifyjs-e675262d51103122720aded924f5571e12086fc9.tar.gz tracifyjs-e675262d51103122720aded924f5571e12086fc9.zip |
suppress false positives in `ufuzz` (#4577)
Diffstat (limited to 'test/ufuzz/index.js')
-rw-r--r-- | test/ufuzz/index.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index 74bd8df9..01863e1a 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -1761,11 +1761,10 @@ function sort_globals(code) { errorln("//-------------------------------------------------------------"); errorln("// !!! sort_globals() failed !!!"); errorln("// expected Array, got:"); - try { - errorln("// " + JSON.stringify(globals)); - } catch (e) { - errorln("// " + globals); - } + if (!sandbox.is_error(globals)) try { + globals = JSON.stringify(globals); + } catch (e) {} + errorln(globals); errorln("//"); errorln(code); errorln(); @@ -1922,6 +1921,7 @@ for (var round = 1; round <= num_iterations; round++) { println("original result:"); println(orig_result[0]); println(); + // ignore v8 parser bug if (is_bug_async_arrow_rest(orig_result[0])) continue; } minify_options.forEach(function(options) { @@ -1934,6 +1934,8 @@ for (var round = 1; round <= num_iterations; round++) { uglify_code = uglify_code.code; uglify_result = sandbox.run_code(uglify_code, toplevel); ok = sandbox.same_stdout(original_result, uglify_result); + // ignore v8 parser bug + if (!ok && is_bug_async_arrow_rest(uglify_result)) ok = true; // ignore declaration order of global variables if (!ok && !toplevel) { ok = sandbox.same_stdout(sandbox.run_code(sort_globals(original_code)), sandbox.run_code(sort_globals(uglify_code))); |