add test for #1640

This commit is contained in:
alexlamsl 2017-03-24 12:27:13 +08:00
parent 73ca6810a5
commit ccaa9a23ef

View File

@ -251,4 +251,14 @@ describe("bin/uglifyjs", function () {
done(); done();
}); });
}); });
it("Should support hyphens as shorthands", function(done) {
var command = uglifyjscmd + ' test/input/issue-1431/sample.js -m keep-fnames=true';
exec(command, function (err, stdout) {
if (err) throw err;
assert.strictEqual(stdout, "function f(r){return function(){function n(n){return n*n}return r(n)}}function g(n){return n(1)+n(2)}console.log(f(g)()==5);\n");
done();
});
})
}); });