improve performance (#3020)

- replace `find_if()` with `all()` wherever possible
- move ESTree-specific logic out of `figure_out_scope()`
This commit is contained in:
Alex Lam S.L
2018-03-23 03:43:52 +08:00
committed by GitHub
parent d1c6bb8c7c
commit 49bfc6b555
5 changed files with 30 additions and 26 deletions

View File

@@ -312,6 +312,15 @@ describe("minify", function() {
assert.strictEqual(err.line, 1);
assert.strictEqual(err.col, 12);
});
it("should reject duplicated label name", function() {
var result = Uglify.minify("L:{L:{}}");
var err = result.error;
assert.ok(err instanceof Error);
assert.strictEqual(err.stack.split(/\n/)[0], "SyntaxError: Label L defined twice");
assert.strictEqual(err.filename, "0");
assert.strictEqual(err.line, 1);
assert.strictEqual(err.col, 4);
});
});
describe("global_defs", function() {