workaround v8 bug with labels (#4467)

closes #4466
This commit is contained in:
Alex Lam S.L
2020-12-27 05:32:18 +00:00
committed by GitHub
parent dd6d7b3d88
commit a8785fb694
5 changed files with 145 additions and 3 deletions

View File

@@ -1799,6 +1799,12 @@ var beautify_options = {
},
};
var minify_options = require("./options.json");
if (typeof sandbox.run_code("A:if (0) B:; else B:;") != "string") {
minify_options.forEach(function(o) {
if (!("mangle" in o)) o.mangle = {};
if (o.mangle) o.mangle.v8 = true;
});
}
if (SUPPORT.destructuring && typeof sandbox.run_code("console.log([ 1 ], {} = 2);") != "string") {
beautify_options.output.v8 = true;
minify_options.forEach(function(o) {