From 49bfc6b555ca3be3084c0819391eabf2839e6f1b Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 23 Mar 2018 03:43:52 +0800 Subject: improve performance (#3020) - replace `find_if()` with `all()` wherever possible - move ESTree-specific logic out of `figure_out_scope()` --- test/mocha/minify.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/mocha/minify.js') 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() { -- cgit v1.2.3