suppress false positives in test/reduce (#5235)

This commit is contained in:
Alex Lam S.L
2021-12-24 19:13:37 +00:00
committed by GitHub
parent bab416465f
commit 13d41778b3
2 changed files with 26 additions and 5 deletions

View File

@@ -418,4 +418,20 @@ describe("test/reduce.js", function() {
if (result.error) throw result.error;
assert.deepEqual(result.warnings, []);
});
it("Should handle thrown falsy values gracefully", function() {
var code = [
"throw 0;",
"setTimeout(null, 42);",
].join("\n");
var result = reduce_test(code, {
mangle: false,
});
if (result.error) throw result.error;
assert.strictEqual(result.code, [
"// Can't reproduce test failure",
"// minify options: {",
'// "mangle": false',
"// }",
].join("\n"));
});
});