From 8250b886b0faf1022ac2308e1cade2da025ebaee Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 16 Sep 2020 14:38:39 -0400 Subject: [PATCH] Create "Test262Error.thrower" as replacement for "$ERROR". Define $ERROR as Test262Error.thrower --- harness/sta.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/harness/sta.js b/harness/sta.js index 42dd47e2eb..ac59d3a110 100644 --- a/harness/sta.js +++ b/harness/sta.js @@ -18,11 +18,12 @@ Test262Error.prototype.toString = function () { return "Test262Error: " + this.message; }; -var $ERROR; -$ERROR = function $ERROR(message) { - throw new Test262Error(message); +Test262Error.thrower = (...args) => { + throw new Test262Error(...args); }; +var $ERROR = Test262Error.thrower; + function $DONOTEVALUATE() { throw "Test262: This statement should not be evaluated."; }