From f85a206b9ed5b39726a2da39680056c09d3f9687 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 22 Dec 2020 18:16:04 +0000 Subject: fix corner case when parsing expression (#4435) --- test/mocha/number-literal.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/mocha') diff --git a/test/mocha/number-literal.js b/test/mocha/number-literal.js index a2b16a9e..61c3a6d6 100644 --- a/test/mocha/number-literal.js +++ b/test/mocha/number-literal.js @@ -89,4 +89,13 @@ describe("Number literals", function() { }, code); }); }); + it("Should reject invalid syntax under expression=true", function() { + assert.throws(function() { + UglifyJS.parse("42.g", { + expression: true, + }); + }, function(e) { + return e instanceof UglifyJS.JS_Parse_Error; + }); + }); }); -- cgit v1.2.3