fix issues in tests flagged by LGTM (#5150)

This commit is contained in:
Alex Lam S.L
2021-10-21 02:07:23 +08:00
committed by GitHub
parent 03aec89f60
commit 32ae994f88
10 changed files with 12 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ describe("String literals", function() {
'"\u2029"',
].forEach(function(input) {
assert.throws(function() {
var ast = UglifyJS.parse(input);
UglifyJS.parse(input);
}, function(e) {
return e instanceof UglifyJS.JS_Parse_Error
&& e.message === "Unterminated string constant";
@@ -44,7 +44,7 @@ describe("String literals", function() {
'"use strict";\n"\\011"',
].forEach(function(input) {
assert.throws(function() {
var output = UglifyJS.parse(input);
UglifyJS.parse(input);
}, function(e) {
return e instanceof UglifyJS.JS_Parse_Error
&& e.message === "Legacy octal escape sequences are not allowed in strict mode";