aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/minify.js
diff options
context:
space:
mode:
authorkzc <kzc@users.noreply.github.com>2017-03-02 02:11:40 -0500
committerAlex Lam S.L <alexlamsl@gmail.com>2017-03-02 15:11:40 +0800
commitee3b39b909c279a0115c7562cab2c9b37fb37c21 (patch)
treeeec94f77b7187dd161d077f3b4478143cf67577f /test/mocha/minify.js
parent9699ffb1afc8bead9fbc3643c6b90b14169ef02c (diff)
downloadtracifyjs-ee3b39b909c279a0115c7562cab2c9b37fb37c21.tar.gz
tracifyjs-ee3b39b909c279a0115c7562cab2c9b37fb37c21.zip
optimize trivial IIFEs returning constants (#1530)
Diffstat (limited to 'test/mocha/minify.js')
-rw-r--r--test/mocha/minify.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/mocha/minify.js b/test/mocha/minify.js
index 2cc800fe..51c46b28 100644
--- a/test/mocha/minify.js
+++ b/test/mocha/minify.js
@@ -155,7 +155,7 @@ describe("minify", function() {
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})();", {
+ var result = Uglify.minify("var a = /*#__PURE__*/(function(){ foo(); })();", {
fromString: true,
output: {
comments: "all",
@@ -163,7 +163,7 @@ describe("minify", function() {
}
});
var code = result.code;
- assert.strictEqual(code, "var a=/*#__PURE__*/function(){return 1}();");
+ assert.strictEqual(code, "var a=/*#__PURE__*/function(){foo()}();");
})
});