Create "Test262Error.thrower" as replacement for "$ERROR". Define $ERROR as Test262Error.thrower

This commit is contained in:
Rick Waldron 2020-09-16 14:38:39 -04:00
parent f94fc660cc
commit 8250b886b0

View File

@ -18,11 +18,12 @@ Test262Error.prototype.toString = function () {
return "Test262Error: " + this.message; return "Test262Error: " + this.message;
}; };
var $ERROR; Test262Error.thrower = (...args) => {
$ERROR = function $ERROR(message) { throw new Test262Error(...args);
throw new Test262Error(message);
}; };
var $ERROR = Test262Error.thrower;
function $DONOTEVALUATE() { function $DONOTEVALUATE() {
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
} }