From e5ab3a572e415dcda66a737078fc3a72f425919e Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 28 Jul 2021 16:47:49 -0400 Subject: [PATCH] chore: migrate $ERROR -> throw new Test262Error in test/language/f* (#3099) --- test/language/function-code/S10.1.6_A1_T1.js | 2 +- test/language/function-code/S10.2.1_A1.js | 6 +++--- test/language/function-code/S10.2.1_A2.js | 6 +++--- test/language/function-code/S10.2.1_A3.js | 2 +- test/language/function-code/S10.2.1_A4_T1.js | 6 +++--- test/language/function-code/S10.4.3_A1.js | 2 +- test/language/function-code/S10.4A1.1_T2.js | 6 +++--- test/language/function-code/S10.4_A1.1_T1.js | 6 +++--- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/language/function-code/S10.1.6_A1_T1.js b/test/language/function-code/S10.1.6_A1_T1.js index edb1c79593..9941606e84 100644 --- a/test/language/function-code/S10.1.6_A1_T1.js +++ b/test/language/function-code/S10.1.6_A1_T1.js @@ -16,4 +16,4 @@ function f1(a){ return a; } if (f1(1) !== 1) - $ERROR('#1: Function parameter was deleted'); + throw new Test262Error('#1: Function parameter was deleted'); diff --git a/test/language/function-code/S10.2.1_A1.js b/test/language/function-code/S10.2.1_A1.js index 84511a9d51..638fd146d5 100644 --- a/test/language/function-code/S10.2.1_A1.js +++ b/test/language/function-code/S10.2.1_A1.js @@ -14,9 +14,9 @@ function f1(a, b){ return (b === undefined); } if(!(f1(1, 2) === false)){ - $ERROR('#1: f1(1, 2) === false'); + throw new Test262Error('#1: f1(1, 2) === false'); } else if(!(f1(1) === true)){ - $ERROR('#1: f1(1) === true'); + throw new Test262Error('#1: f1(1) === true'); } //CHECK#2 @@ -24,5 +24,5 @@ function f2(a, b, c){ return (b === undefined) && (c === undefined); } if(!(f2(1) === true)){ - $ERROR('#2: f2(1) === true'); + throw new Test262Error('#2: f2(1) === true'); } diff --git a/test/language/function-code/S10.2.1_A2.js b/test/language/function-code/S10.2.1_A2.js index b92b224b0f..f72bbf8b78 100644 --- a/test/language/function-code/S10.2.1_A2.js +++ b/test/language/function-code/S10.2.1_A2.js @@ -18,7 +18,7 @@ function f1(x, x) { return x; } if(!(f1(1, 2) === 2)) { - $ERROR("#1: f1(1, 2) === 2"); + throw new Test262Error("#1: f1(1, 2) === 2"); } //CHECK#2 @@ -26,7 +26,7 @@ function f2(x, x, x){ return x*x*x; } if(!(f2(1, 2, 3) === 27)){ - $ERROR("f2(1, 2, 3) === 27"); + throw new Test262Error("f2(1, 2, 3) === 27"); } //CHECK#3 @@ -34,5 +34,5 @@ function f3(x, x) { return 'a' + x; } if(!(f3(1, 2) === 'a2')){ - $ERROR("#3: f3(1, 2) === 'a2'"); + throw new Test262Error("#3: f3(1, 2) === 'a2'"); } diff --git a/test/language/function-code/S10.2.1_A3.js b/test/language/function-code/S10.2.1_A3.js index dd3456818a..bf7bd1940b 100644 --- a/test/language/function-code/S10.2.1_A3.js +++ b/test/language/function-code/S10.2.1_A3.js @@ -19,5 +19,5 @@ function f1(x, a, b, x){ return x; } if(!(f1(1, 2) === undefined)){ - $ERROR('#1: f1(1, 2) === undefined'); + throw new Test262Error('#1: f1(1, 2) === undefined'); } diff --git a/test/language/function-code/S10.2.1_A4_T1.js b/test/language/function-code/S10.2.1_A4_T1.js index 6a6e43d106..3988865c1c 100644 --- a/test/language/function-code/S10.2.1_A4_T1.js +++ b/test/language/function-code/S10.2.1_A4_T1.js @@ -21,7 +21,7 @@ function f1(x){ } } if(!(f1().constructor.prototype === Function.prototype)){ - $ERROR('#1: f1() returns function'); + throw new Test262Error('#1: f1() returns function'); } //CHECK#2 @@ -33,7 +33,7 @@ function f2(x){ } } if(!(f2() === "function")){ - $ERROR('#2: f2() === "function"'); + throw new Test262Error('#2: f2() === "function"'); } //CHECK#3 @@ -44,5 +44,5 @@ function f3() { } } if (!(f3() === "function")){ - $ERROR('#3: f3() === "function"'); + throw new Test262Error('#3: f3() === "function"'); } diff --git a/test/language/function-code/S10.4.3_A1.js b/test/language/function-code/S10.4.3_A1.js index 383d2cad98..9a40358d6e 100644 --- a/test/language/function-code/S10.4.3_A1.js +++ b/test/language/function-code/S10.4.3_A1.js @@ -11,5 +11,5 @@ flags: [onlyStrict] var that = (function() { return this; })(); if (that !== undefined) { - $ERROR('#1: "this" leaked as: ' + that); + throw new Test262Error('#1: "this" leaked as: ' + that); } diff --git a/test/language/function-code/S10.4A1.1_T2.js b/test/language/function-code/S10.4A1.1_T2.js index 21060a8f19..070745e163 100644 --- a/test/language/function-code/S10.4A1.1_T2.js +++ b/test/language/function-code/S10.4A1.1_T2.js @@ -11,8 +11,8 @@ var y; function f(a){ var x; - - if (a === 1) + + if (a === 1) return x; else { if(x === undefined) { @@ -27,5 +27,5 @@ function f(a){ y = f(0); if(!(y === undefined)){ - $ERROR("#1: Recursive function calls shares execution context"); + throw new Test262Error("#1: Recursive function calls shares execution context"); } diff --git a/test/language/function-code/S10.4_A1.1_T1.js b/test/language/function-code/S10.4_A1.1_T1.js index d44b753e3c..bde18d6610 100644 --- a/test/language/function-code/S10.4_A1.1_T1.js +++ b/test/language/function-code/S10.4_A1.1_T1.js @@ -11,13 +11,13 @@ var y; function f(){ var x; - + if(x === undefined) { x = 0; } else { x = 1; } - + return x; } @@ -25,5 +25,5 @@ y = f(); y = f(); if(!(y === 0)){ - $ERROR("#1: Sequenced function calls shares execution context"); + throw new Test262Error("#1: Sequenced function calls shares execution context"); }