diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-03-23 03:43:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-23 03:43:52 +0800 |
commit | 49bfc6b555ca3be3084c0819391eabf2839e6f1b (patch) | |
tree | 12dda86d5f4feeb1a643e169e5daccdabc35112d /test/mocha/minify.js | |
parent | d1c6bb8c7c4cc491c4bb52e14ac2127a2496fbb8 (diff) | |
download | tracifyjs-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.js | 9 |
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() { |