remove all /*@__PURE__*/ on output
This commit is contained in:
parent
5713261fbf
commit
d4e0eb6917
|
|
@ -3148,7 +3148,6 @@ merge(Compressor.prototype, {
|
||||||
}
|
}
|
||||||
if (this.pure) {
|
if (this.pure) {
|
||||||
compressor.warn("Dropping __PURE__ call [{file}:{line},{col}]", this.start);
|
compressor.warn("Dropping __PURE__ call [{file}:{line},{col}]", this.start);
|
||||||
this.pure.value = this.pure.value.replace(/[@#]__PURE__/g, ' ');
|
|
||||||
}
|
}
|
||||||
var args = trim(this.args, compressor, first_in_statement);
|
var args = trim(this.args, compressor, first_in_statement);
|
||||||
return args && make_sequence(this, args);
|
return args && make_sequence(this, args);
|
||||||
|
|
|
||||||
|
|
@ -510,11 +510,11 @@ function OutputStream(options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (/comment[134]/.test(c.type)) {
|
if (/comment[134]/.test(c.type)) {
|
||||||
print("//" + c.value + "\n");
|
print("//" + c.value.replace(/[@#]__PURE__/g, ' ') + "\n");
|
||||||
indent();
|
indent();
|
||||||
last_nlb = true;
|
last_nlb = true;
|
||||||
} else if (c.type == "comment2") {
|
} else if (c.type == "comment2") {
|
||||||
print("/*" + c.value + "*/");
|
print("/*" + c.value.replace(/[@#]__PURE__/g, ' ') + "*/");
|
||||||
last_nlb = false;
|
last_nlb = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -550,10 +550,10 @@ function OutputStream(options) {
|
||||||
space();
|
space();
|
||||||
}
|
}
|
||||||
if (/comment[134]/.test(c.type)) {
|
if (/comment[134]/.test(c.type)) {
|
||||||
print("//" + c.value);
|
print("//" + c.value.replace(/[@#]__PURE__/g, ' '));
|
||||||
need_newline_indented = true;
|
need_newline_indented = true;
|
||||||
} else if (c.type == "comment2") {
|
} else if (c.type == "comment2") {
|
||||||
print("/*" + c.value + "*/");
|
print("/*" + c.value.replace(/[@#]__PURE__/g, ' ') + "*/");
|
||||||
need_space = true;
|
need_space = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ describe("minify", function() {
|
||||||
var code = result.code;
|
var code = result.code;
|
||||||
assert.strictEqual(code, "// comment1 comment2\nbar();");
|
assert.strictEqual(code, "// comment1 comment2\nbar();");
|
||||||
});
|
});
|
||||||
it("should not drop #__PURE__ hint if function is retained", function() {
|
it("should drop #__PURE__ hint if function is retained", function() {
|
||||||
var result = Uglify.minify("var a = /*#__PURE__*/(function(){ foo(); })();", {
|
var result = Uglify.minify("var a = /*#__PURE__*/(function(){ foo(); })();", {
|
||||||
output: {
|
output: {
|
||||||
comments: "all",
|
comments: "all",
|
||||||
|
|
@ -255,7 +255,7 @@ describe("minify", function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var code = result.code;
|
var code = result.code;
|
||||||
assert.strictEqual(code, "var a=/*#__PURE__*/function(){foo()}();");
|
assert.strictEqual(code, "var a=/* */function(){foo()}();");
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user