Skip to content

Commit 7722e98

Browse files
bakkotptomato
authored andcommitted
avoid re-using Test262Error
1 parent ff1f256 commit 7722e98

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ assert.throws(RangeError, function() {
4141
assert.sameValue(closed, true);
4242

4343
closed = false;
44-
assert.throws(Test262Error, function() {
45-
closable.drop({ get valueOf() { throw new Test262Error(); }});
44+
class ShouldNotGetValueOf {}
45+
assert.throws(ShouldNotGetValueOf, function() {
46+
closable.drop({ get valueOf() { throw new ShouldNotGetValueOf(); }});
4647
});
4748
assert.sameValue(closed, true);

test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ assert.throws(RangeError, function() {
4141
assert.sameValue(closed, true);
4242

4343
closed = false;
44-
assert.throws(Test262Error, function() {
45-
closable.take({ get valueOf() { throw new Test262Error(); }});
44+
class ShouldNotGetValueOf {}
45+
assert.throws(ShouldNotGetValueOf, function() {
46+
closable.take({ get valueOf() { throw new ShouldNotGetValueOf(); }});
4647
});
4748
assert.sameValue(closed, true);

0 commit comments

Comments
 (0)