warn & drop #__PURE__ iff IIFE is dropped (#1511)
- consolidate `side-effects` optimisations - improve string `+` optimisation - enhance literal & `conditionals` optimisations
This commit is contained in:
@@ -154,6 +154,17 @@ describe("minify", function() {
|
||||
var code = result.code;
|
||||
assert.strictEqual(code, "// comment1 comment2\nbar();");
|
||||
});
|
||||
it("should not drop #__PURE__ hint if function is retained", function() {
|
||||
var result = Uglify.minify("var a = /*#__PURE__*/(function(){return 1})();", {
|
||||
fromString: true,
|
||||
output: {
|
||||
comments: "all",
|
||||
beautify: false,
|
||||
}
|
||||
});
|
||||
var code = result.code;
|
||||
assert.strictEqual(code, "var a=/*#__PURE__*/function(){return 1}();");
|
||||
})
|
||||
});
|
||||
|
||||
describe("JS_Parse_Error", function() {
|
||||
|
||||
Reference in New Issue
Block a user