aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-22 18:16:04 +0000
committerGitHub <noreply@github.com>2020-12-23 02:16:04 +0800
commitf85a206b9ed5b39726a2da39680056c09d3f9687 (patch)
treeccd570d6abb0d3e25b44f53b9db4ca137feb586c /test
parentbba7cd0a70551617a243a9c78ec18eef42f89ad6 (diff)
downloadtracifyjs-f85a206b9ed5b39726a2da39680056c09d3f9687.tar.gz
tracifyjs-f85a206b9ed5b39726a2da39680056c09d3f9687.zip
fix corner case when parsing expression (#4435)
Diffstat (limited to 'test')
-rw-r--r--test/mocha/number-literal.js9
1 files changed, 9 insertions, 0 deletions
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;
+ });
+ });
});