fix corner case when parsing expression (#4435)

This commit is contained in:
Alex Lam S.L
2020-12-22 18:16:04 +00:00
committed by GitHub
parent bba7cd0a70
commit f85a206b9e
2 changed files with 16 additions and 6 deletions

View File

@@ -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;
});
});
});