Normalize error messages
This commit is contained in:
committed by
Richard van Velzen
parent
2149bfb707
commit
6c99816855
@@ -168,7 +168,7 @@ describe("Directives", function() {
|
||||
throw new Error("Expected parser to fail");
|
||||
} catch (e) {
|
||||
assert.strictEqual(e instanceof uglify.JS_Parse_Error, true);
|
||||
assert.strictEqual(e.message, "Unexpected token: punc (])");
|
||||
assert.strictEqual(e.message, "SyntaxError: Unexpected token: punc (])");
|
||||
}
|
||||
|
||||
test_directive(tokenizer, tests[i]);
|
||||
@@ -367,4 +367,4 @@ describe("Directives", function() {
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -71,7 +71,7 @@ describe("Getters and setters", function() {
|
||||
var fail = function(data) {
|
||||
return function (e) {
|
||||
return e instanceof UglifyJS.JS_Parse_Error &&
|
||||
e.message === "Invalid getter/setter name: " + data.operator;
|
||||
e.message === "SyntaxError: Invalid getter/setter name: " + data.operator;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ describe("With", function() {
|
||||
}
|
||||
var error = function(e) {
|
||||
return e instanceof uglify.JS_Parse_Error &&
|
||||
e.message === "Strict mode may not include a with statement";
|
||||
e.message === "SyntaxError: Strict mode may not include a with statement";
|
||||
}
|
||||
assert.throws(test, error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user