mirror of
https://github.com/tc39/test262.git
synced 2025-07-22 21:45:04 +02:00
Simplify test
Remove semantics which are not necessary to exercise the behavior under test.
This commit is contained in:
parent
c4e54648c0
commit
b62a070221
@ -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');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user