From c5e8aa9ca2c959ae4a98d59afee66f39306c3196 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 16 Sep 2020 13:57:40 -0400 Subject: [PATCH] Migrate test/harness/* away from dependence on $ERROR(). Close gh-742 --- test/harness/assert-false.js | 4 ++-- test/harness/assert-notsamevalue-nan.js | 4 ++-- test/harness/assert-notsamevalue-tostring.js | 4 ++-- test/harness/assert-obj.js | 4 ++-- test/harness/assert-samevalue-objects.js | 4 ++-- test/harness/assert-samevalue-tostring.js | 4 ++-- test/harness/assert-samevalue-zeros.js | 4 ++-- test/harness/assert-throws-incorrect-ctor.js | 4 ++-- test/harness/assert-throws-no-arg.js | 4 ++-- test/harness/assert-throws-no-error.js | 4 ++-- test/harness/assert-throws-null-fn.js | 12 +++++------ test/harness/assert-throws-null.js | 4 ++-- test/harness/assert-throws-primitive.js | 4 ++-- test/harness/assert-throws-single-arg.js | 4 ++-- test/harness/assert-tostring.js | 4 ++-- test/harness/assertRelativeDateMs.js | 20 +++++++++---------- .../compare-array-different-elements.js | 2 +- .../harness/compare-array-different-length.js | 4 ++-- test/harness/compare-array-empty.js | 2 +- ...are-array-same-elements-different-order.js | 2 +- .../compare-array-same-elements-same-order.js | 2 +- test/harness/compare-array-sparse.js | 10 +++++----- ...etachArrayBuffer-host-detachArrayBuffer.js | 6 +++--- test/harness/detachArrayBuffer.js | 4 ++-- test/harness/nativeFunctionMatcher.js | 4 ++-- test/harness/promiseHelper.js | 4 ++-- ...per-verifyconfigurable-not-configurable.js | 4 ++-- ...-verifyenumerable-not-enumerable-symbol.js | 2 +- ...yhelper-verifyenumerable-not-enumerable.js | 2 +- ...lper-verifynotconfigurable-configurable.js | 4 ++-- ...tyhelper-verifynotenumerable-enumerable.js | 2 +- ...r-verifynotwritable-not-writable-strict.js | 2 +- ...opertyhelper-verifynotwritable-writable.js | 4 ++-- ...pertyhelper-verifywritable-not-writable.js | 4 ++-- .../propertyhelper-verifywritable-writable.js | 2 +- test/harness/sta-error.js | 2 +- .../testTypedArray-conversions-call-error.js | 2 +- test/harness/verifyProperty-value-error.js | 4 ++-- 38 files changed, 81 insertions(+), 81 deletions(-) diff --git a/test/harness/assert-false.js b/test/harness/assert-false.js index 93b8205813..110e652dc2 100644 --- a/test/harness/assert-false.js +++ b/test/harness/assert-false.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,5 +21,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-notsamevalue-nan.js b/test/harness/assert-notsamevalue-nan.js index 856cc482c7..8e7aaf3184 100644 --- a/test/harness/assert-notsamevalue-nan.js +++ b/test/harness/assert-notsamevalue-nan.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,5 +21,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-notsamevalue-tostring.js b/test/harness/assert-notsamevalue-tostring.js index 0442541b59..a5bab76b53 100644 --- a/test/harness/assert-notsamevalue-tostring.js +++ b/test/harness/assert-notsamevalue-tostring.js @@ -15,10 +15,10 @@ try { } catch (err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR('Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.'); + throw new Error('Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.'); } } if (!threw) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-obj.js b/test/harness/assert-obj.js index edaf82fc69..17720f6bdc 100644 --- a/test/harness/assert-obj.js +++ b/test/harness/assert-obj.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,5 +21,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-samevalue-objects.js b/test/harness/assert-samevalue-objects.js index 833f864b4d..e577c58752 100644 --- a/test/harness/assert-samevalue-objects.js +++ b/test/harness/assert-samevalue-objects.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,5 +21,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-samevalue-tostring.js b/test/harness/assert-samevalue-tostring.js index f17143c08e..377e4cfb4a 100644 --- a/test/harness/assert-samevalue-tostring.js +++ b/test/harness/assert-samevalue-tostring.js @@ -15,10 +15,10 @@ try { } catch (err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR('Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.'); + throw new Error('Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.'); } } if (!threw) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-samevalue-zeros.js b/test/harness/assert-samevalue-zeros.js index 762634a67d..4c4ef717d3 100644 --- a/test/harness/assert-samevalue-zeros.js +++ b/test/harness/assert-samevalue-zeros.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -22,5 +22,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-incorrect-ctor.js b/test/harness/assert-throws-incorrect-ctor.js index b12f06ee77..f3926cbb60 100644 --- a/test/harness/assert-throws-incorrect-ctor.js +++ b/test/harness/assert-throws-incorrect-ctor.js @@ -16,7 +16,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -24,5 +24,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-no-arg.js b/test/harness/assert-throws-no-arg.js index c8a9f3510b..dc73e58c84 100644 --- a/test/harness/assert-throws-no-arg.js +++ b/test/harness/assert-throws-no-arg.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,5 +21,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-no-error.js b/test/harness/assert-throws-no-error.js index d40b06b44c..efa01ed1c9 100644 --- a/test/harness/assert-throws-no-error.js +++ b/test/harness/assert-throws-no-error.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,5 +21,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-null-fn.js b/test/harness/assert-throws-null-fn.js index 741751498a..dddff6b32e 100644 --- a/test/harness/assert-throws-null-fn.js +++ b/test/harness/assert-throws-null-fn.js @@ -13,7 +13,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -21,7 +21,7 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } threw = false; @@ -31,7 +31,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -39,7 +39,7 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } threw = false; @@ -49,7 +49,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -57,5 +57,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-null.js b/test/harness/assert-throws-null.js index 7b10f61247..10138edde1 100644 --- a/test/harness/assert-throws-null.js +++ b/test/harness/assert-throws-null.js @@ -15,7 +15,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -23,5 +23,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-primitive.js b/test/harness/assert-throws-primitive.js index 0a2d8f9e2a..7c7d2ac5a5 100644 --- a/test/harness/assert-throws-primitive.js +++ b/test/harness/assert-throws-primitive.js @@ -14,7 +14,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -22,5 +22,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-throws-single-arg.js b/test/harness/assert-throws-single-arg.js index 2b8ca71356..3caeb8ca2b 100644 --- a/test/harness/assert-throws-single-arg.js +++ b/test/harness/assert-throws-single-arg.js @@ -12,7 +12,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -20,5 +20,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assert-tostring.js b/test/harness/assert-tostring.js index 0b7870421e..6e9c89e958 100644 --- a/test/harness/assert-tostring.js +++ b/test/harness/assert-tostring.js @@ -15,10 +15,10 @@ try { } catch (err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR('Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.'); + throw new Error('Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.'); } } if (!threw) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/assertRelativeDateMs.js b/test/harness/assertRelativeDateMs.js index c8c08b3b67..9128c6acd8 100644 --- a/test/harness/assertRelativeDateMs.js +++ b/test/harness/assertRelativeDateMs.js @@ -26,9 +26,9 @@ try { thrown = err; } if (!thrown) { - $ERROR('Expected error, but no error was thrown.'); + throw new Error('Expected error, but no error was thrown.'); } else if (thrown.constructor !== Test262Error) { - $ERROR('Expected error of type Test262Error.'); + throw new Error('Expected error of type Test262Error.'); } thrown = null; @@ -38,9 +38,9 @@ try { thrown = err; } if (!thrown) { - $ERROR('Expected error, but no error was thrown.'); + throw new Error('Expected error, but no error was thrown.'); } else if (thrown.constructor !== Test262Error) { - $ERROR('Expected error of type Test262Error.'); + throw new Error('Expected error of type Test262Error.'); } thrown = null; @@ -50,9 +50,9 @@ try { thrown = err; } if (!thrown) { - $ERROR('Expected error, but no error was thrown.'); + throw new Error('Expected error, but no error was thrown.'); } else if (thrown.constructor !== Test262Error) { - $ERROR('Expected error of type Test262Error.'); + throw new Error('Expected error of type Test262Error.'); } thrown = null; @@ -62,9 +62,9 @@ try { thrown = err; } if (!thrown) { - $ERROR('Expected error, but no error was thrown.'); + throw new Error('Expected error, but no error was thrown.'); } else if (thrown.constructor !== Test262Error) { - $ERROR('Expected error of type Test262Error.'); + throw new Error('Expected error of type Test262Error.'); } thrown = null; @@ -74,7 +74,7 @@ try { thrown = err; } if (!thrown) { - $ERROR('Expected error, but no error was thrown.'); + throw new Error('Expected error, but no error was thrown.'); } else if (thrown.constructor !== Test262Error) { - $ERROR('Expected error of type Test262Error.'); + throw new Error('Expected error of type Test262Error.'); } diff --git a/test/harness/compare-array-different-elements.js b/test/harness/compare-array-different-elements.js index 32ed51c819..7519d96a9d 100644 --- a/test/harness/compare-array-different-elements.js +++ b/test/harness/compare-array-different-elements.js @@ -11,5 +11,5 @@ var first = [0, 'a', undefined]; var second = [0, 'b', undefined]; if (compareArray(first, second) !== false) { - $ERROR('Arrays containing different elements are not equivalent.'); + throw new Error('Arrays containing different elements are not equivalent.'); } diff --git a/test/harness/compare-array-different-length.js b/test/harness/compare-array-different-length.js index df48a86638..a188fc2628 100644 --- a/test/harness/compare-array-different-length.js +++ b/test/harness/compare-array-different-length.js @@ -8,9 +8,9 @@ includes: [compareArray.js] ---*/ if (compareArray([], [undefined]) !== false) { - $ERROR('Arrays of differing lengths are not equivalent.'); + throw new Error('Arrays of differing lengths are not equivalent.'); } if (compareArray([undefined], []) !== false) { - $ERROR('Arrays of differing lengths are not equivalent.'); + throw new Error('Arrays of differing lengths are not equivalent.'); } diff --git a/test/harness/compare-array-empty.js b/test/harness/compare-array-empty.js index f3196db4c4..af701fd418 100644 --- a/test/harness/compare-array-empty.js +++ b/test/harness/compare-array-empty.js @@ -8,5 +8,5 @@ includes: [compareArray.js] ---*/ if (compareArray([], []) !== true) { - $ERROR('Empty arrays are equivalent.'); + throw new Error('Empty arrays are equivalent.'); } diff --git a/test/harness/compare-array-same-elements-different-order.js b/test/harness/compare-array-same-elements-different-order.js index 243d670bae..aa384c7cb7 100644 --- a/test/harness/compare-array-same-elements-different-order.js +++ b/test/harness/compare-array-same-elements-different-order.js @@ -12,5 +12,5 @@ var first = [0, 1, '', 's', null, undefined, obj]; var second = [0, 1, '', 's', undefined, null, obj]; if (compareArray(first, second) !== false) { - $ERROR('Arrays containing the same elements in different order are not equivalent.'); + throw new Error('Arrays containing the same elements in different order are not equivalent.'); } diff --git a/test/harness/compare-array-same-elements-same-order.js b/test/harness/compare-array-same-elements-same-order.js index ac09fed284..e363528ff7 100644 --- a/test/harness/compare-array-same-elements-same-order.js +++ b/test/harness/compare-array-same-elements-same-order.js @@ -12,5 +12,5 @@ var first = [0, 1, '', 's', undefined, null, obj]; var second = [0, 1, '', 's', undefined, null, obj]; if (compareArray(first, second) !== true) { - $ERROR('Arrays containing the same elements in the same order are equivalent.'); + throw new Error('Arrays containing the same elements in the same order are equivalent.'); } diff --git a/test/harness/compare-array-sparse.js b/test/harness/compare-array-sparse.js index 316039a06f..ce2f4ae4f2 100644 --- a/test/harness/compare-array-sparse.js +++ b/test/harness/compare-array-sparse.js @@ -8,21 +8,21 @@ includes: [compareArray.js] ---*/ if (compareArray([,], [,]) !== true) { - $ERROR('Sparse arrays of the same length are equivalent.'); + throw new Error('Sparse arrays of the same length are equivalent.'); } if (compareArray([,], [,,]) !== false) { - $ERROR('Sparse arrays of differing lengths are not equivalent.'); + throw new Error('Sparse arrays of differing lengths are not equivalent.'); } if (compareArray([,,], [,]) !== false) { - $ERROR('Sparse arrays of differing lengths are not equivalent.'); + throw new Error('Sparse arrays of differing lengths are not equivalent.'); } if (compareArray([,], []) !== false) { - $ERROR('Sparse arrays are not equivalent to empty arrays.'); + throw new Error('Sparse arrays are not equivalent to empty arrays.'); } if (compareArray([], [,]) !== false) { - $ERROR('Sparse arrays are not equivalent to empty arrays.'); + throw new Error('Sparse arrays are not equivalent to empty arrays.'); } diff --git a/test/harness/detachArrayBuffer-host-detachArrayBuffer.js b/test/harness/detachArrayBuffer-host-detachArrayBuffer.js index 2eb65d74f9..b0714a1523 100644 --- a/test/harness/detachArrayBuffer-host-detachArrayBuffer.js +++ b/test/harness/detachArrayBuffer-host-detachArrayBuffer.js @@ -26,18 +26,18 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); } if (err.message !== '$262.detachArrayBuffer called.') { - $ERROR(`Expected error message: ${err.message}`); + throw new Error(`Expected error message: ${err.message}`); } } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/detachArrayBuffer.js b/test/harness/detachArrayBuffer.js index 6c25d36eda..4f95312b95 100644 --- a/test/harness/detachArrayBuffer.js +++ b/test/harness/detachArrayBuffer.js @@ -19,7 +19,7 @@ try { } catch(err) { threw = true; if (err.constructor !== ReferenceError) { - $ERROR( + throw new Error( 'Expected a ReferenceError, but a "' + err.constructor.name + '" was thrown.' ); @@ -27,7 +27,7 @@ try { } if (threw === false) { - $ERROR('Expected a ReferenceError, but no error was thrown.'); + throw new Error('Expected a ReferenceError, but no error was thrown.'); } diff --git a/test/harness/nativeFunctionMatcher.js b/test/harness/nativeFunctionMatcher.js index c8e49b46e6..49fdc3e822 100644 --- a/test/harness/nativeFunctionMatcher.js +++ b/test/harness/nativeFunctionMatcher.js @@ -31,7 +31,7 @@ includes: [nativeFunctionMatcher.js] try { validateNativeFunctionSource(s); } catch (unused) { - $ERROR(`${JSON.stringify(s)} should pass`); + throw new Error(`${JSON.stringify(s)} should pass`); } }); @@ -55,6 +55,6 @@ includes: [nativeFunctionMatcher.js] fail = true; } catch (unused) {} if (fail) { - $ERROR(`${JSON.stringify(s)} should fail`); + throw new Error(`${JSON.stringify(s)} should fail`); } }); diff --git a/test/harness/promiseHelper.js b/test/harness/promiseHelper.js index d65271dad1..db56dff43a 100644 --- a/test/harness/promiseHelper.js +++ b/test/harness/promiseHelper.js @@ -22,7 +22,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -30,6 +30,6 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifyconfigurable-not-configurable.js b/test/harness/propertyhelper-verifyconfigurable-not-configurable.js index e696ab4527..105f696efc 100644 --- a/test/harness/propertyhelper-verifyconfigurable-not-configurable.js +++ b/test/harness/propertyhelper-verifyconfigurable-not-configurable.js @@ -19,7 +19,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -27,5 +27,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifyenumerable-not-enumerable-symbol.js b/test/harness/propertyhelper-verifyenumerable-not-enumerable-symbol.js index ab36f14cc2..744010fa68 100644 --- a/test/harness/propertyhelper-verifyenumerable-not-enumerable-symbol.js +++ b/test/harness/propertyhelper-verifyenumerable-not-enumerable-symbol.js @@ -28,5 +28,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifyenumerable-not-enumerable.js b/test/harness/propertyhelper-verifyenumerable-not-enumerable.js index fb4ccc031d..21a75803ef 100644 --- a/test/harness/propertyhelper-verifyenumerable-not-enumerable.js +++ b/test/harness/propertyhelper-verifyenumerable-not-enumerable.js @@ -26,5 +26,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifynotconfigurable-configurable.js b/test/harness/propertyhelper-verifynotconfigurable-configurable.js index 6db04baf83..d02ce26d7b 100644 --- a/test/harness/propertyhelper-verifynotconfigurable-configurable.js +++ b/test/harness/propertyhelper-verifynotconfigurable-configurable.js @@ -18,7 +18,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -26,5 +26,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifynotenumerable-enumerable.js b/test/harness/propertyhelper-verifynotenumerable-enumerable.js index 3c762340c0..617efa9188 100644 --- a/test/harness/propertyhelper-verifynotenumerable-enumerable.js +++ b/test/harness/propertyhelper-verifynotenumerable-enumerable.js @@ -18,7 +18,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); diff --git a/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js b/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js index dbfc65bf6a..b9b9f7d759 100644 --- a/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js +++ b/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js @@ -17,5 +17,5 @@ Object.defineProperty(obj, 'a', { verifyNotWritable(obj, 'a'); if (obj.a !== 123) { - $ERROR('`verifyNotWritable` should be non-destructive.'); + throw new Error('`verifyNotWritable` should be non-destructive.'); } diff --git a/test/harness/propertyhelper-verifynotwritable-writable.js b/test/harness/propertyhelper-verifynotwritable-writable.js index d86e5af37e..d31eb9bcb7 100644 --- a/test/harness/propertyhelper-verifynotwritable-writable.js +++ b/test/harness/propertyhelper-verifynotwritable-writable.js @@ -18,7 +18,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -26,5 +26,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifywritable-not-writable.js b/test/harness/propertyhelper-verifywritable-not-writable.js index a038d19535..1731eac005 100644 --- a/test/harness/propertyhelper-verifywritable-not-writable.js +++ b/test/harness/propertyhelper-verifywritable-not-writable.js @@ -18,7 +18,7 @@ try { } catch(err) { threw = true; if (err.constructor !== Test262Error) { - $ERROR( + throw new Error( 'Expected a Test262Error, but a "' + err.constructor.name + '" was thrown.' ); @@ -26,5 +26,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/propertyhelper-verifywritable-writable.js b/test/harness/propertyhelper-verifywritable-writable.js index 884b7a8dfb..d123bef944 100644 --- a/test/harness/propertyhelper-verifywritable-writable.js +++ b/test/harness/propertyhelper-verifywritable-writable.js @@ -16,5 +16,5 @@ Object.defineProperty(obj, 'a', { verifyWritable(obj, 'a'); if (obj.a !== 123) { - $ERROR('`verifyWritable` should be non-destructive.'); + throw new Error('`verifyWritable` should be non-destructive.'); } diff --git a/test/harness/sta-error.js b/test/harness/sta-error.js index f5d8e695eb..495ce86d91 100644 --- a/test/harness/sta-error.js +++ b/test/harness/sta-error.js @@ -24,5 +24,5 @@ try { } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); } diff --git a/test/harness/testTypedArray-conversions-call-error.js b/test/harness/testTypedArray-conversions-call-error.js index 479d48f195..c6c3b634a3 100644 --- a/test/harness/testTypedArray-conversions-call-error.js +++ b/test/harness/testTypedArray-conversions-call-error.js @@ -24,7 +24,7 @@ try { } if (threw === false) { - $ERROR('Expected a TypeError, but no error was thrown.'); + throw new Error('Expected a TypeError, but no error was thrown.'); } diff --git a/test/harness/verifyProperty-value-error.js b/test/harness/verifyProperty-value-error.js index 0145cac2e8..169c6657ed 100644 --- a/test/harness/verifyProperty-value-error.js +++ b/test/harness/verifyProperty-value-error.js @@ -30,10 +30,10 @@ try { } if (err.message !== 'descriptor value should be 2') { - $ERROR('The error thrown did not define the specified message.'); + throw new Error('The error thrown did not define the specified message.'); } } if (threw === false) { - $ERROR('Expected a Test262Error, but no error was thrown.'); + throw new Error('Expected a Test262Error, but no error was thrown.'); }