blob: 8b0ea4ba21630c794b84c1f998aa2280cf845e12 [file] [log] [blame]
function shouldThrowSyntaxError(str, message) {
try {
eval(str);
throw new Error("Expected `" + str + "` to throw a SyntaxError, but did not throw.")
} catch (e) {
if (e.constructor !== SyntaxError)
throw new Error("Expected `" + str + "` to throw a SyntaxError, but threw '" + e + "'");
if (message !== void 0 && e.message !== message)
throw new Error("Expected `" + str + "` to throw SyntaxError: '" + message + "', but threw '" + e + "'");
}
}
shouldThrowSyntaxError("0/-async J", "Unexpected identifier 'J'")