improve rename reproducibility (#2754)

fixes #2752
This commit is contained in:
Alex Lam S.L
2018-01-09 13:53:05 +08:00
committed by GitHub
parent ce27bcd69a
commit 2e22d38a02
2 changed files with 15 additions and 0 deletions

View File

@@ -373,4 +373,18 @@ describe("minify", function() {
assert.strictEqual(stat.print_to_string(), "a=x()");
});
});
describe("rename", function() {
it("Should be repeatable", function() {
var code = "!function(x){return x(x)}(y);";
for (var i = 0; i < 2; i++) {
assert.strictEqual(Uglify.minify(code, {
compress: {
toplevel: true,
},
rename: true,
}).code, "var a2;(a2=y)(a2);");
}
});
});
});