aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/minify.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-03-23 03:43:52 +0800
committerGitHub <noreply@github.com>2018-03-23 03:43:52 +0800
commit49bfc6b555ca3be3084c0819391eabf2839e6f1b (patch)
tree12dda86d5f4feeb1a643e169e5daccdabc35112d /test/mocha/minify.js
parentd1c6bb8c7c4cc491c4bb52e14ac2127a2496fbb8 (diff)
downloadtracifyjs-49bfc6b555ca3be3084c0819391eabf2839e6f1b.tar.gz
tracifyjs-49bfc6b555ca3be3084c0819391eabf2839e6f1b.zip
improve performance (#3020)
- replace `find_if()` with `all()` wherever possible - move ESTree-specific logic out of `figure_out_scope()`
Diffstat (limited to 'test/mocha/minify.js')
-rw-r--r--test/mocha/minify.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mocha/minify.js b/test/mocha/minify.js
index 02180a59..995897da 100644
--- a/test/mocha/minify.js
+++ b/test/mocha/minify.js
@@ -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() {