Simplify test

Remove semantics which are not necessary to exercise the behavior under
test.
This commit is contained in:
Mike Pennisi 2021-09-03 16:04:52 -04:00 committed by Rick Waldron
parent c4e54648c0
commit b62a070221

View File

@ -13,13 +13,10 @@ info: |
3. For each element _number_ of _coerced_, do 3. For each element _number_ of _coerced_, do
---*/ ---*/
let uniqueErrorCount = 0; var counter = 0;
class UniqueError extends Error {
constructor() { super(); uniqueErrorCount++; }
}
assert.throws( assert.throws(
UniqueError, Test262Error,
function() { function() {
Math.hypot( Math.hypot(
Infinity, Infinity,
@ -27,12 +24,12 @@ assert.throws(
NaN, NaN,
0, 0,
-0, -0,
{valueOf(){ throw new UniqueError(); }}, {valueOf: function(){ throw new Test262Error(); }},
{valueOf(){ throw new UniqueError(); }}, {valueOf: function(){ counter++; }}
); );
}, },
'Math.hypot propagates an abrupt completion from coercing an argument to Number' 'Math.hypot propagates an abrupt completion from coercing an argument to Number'
); );
assert.sameValue(uniqueErrorCount, 1, assert.sameValue(counter, 0,
'Math.hypot aborts argument processing at the first abrupt completion'); 'Math.hypot aborts argument processing at the first abrupt completion');