Skip to content

Commit

Permalink
avoid re-using Test262Error
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Feb 3, 2025
1 parent a473a2e commit 652ac6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ assert.throws(RangeError, function() {
assert.sameValue(closed, true);

closed = false;
assert.throws(Test262Error, function() {
closable.drop({ get valueOf() { throw new Test262Error(); }});
class ShouldNotGetValueOf {}
assert.throws(ShouldNotGetValueOf, function() {
closable.drop({ get valueOf() { throw new ShouldNotGetValueOf(); }});
});
assert.sameValue(closed, true);
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ assert.throws(RangeError, function() {
assert.sameValue(closed, true);

closed = false;
assert.throws(Test262Error, function() {
closable.take({ get valueOf() { throw new Test262Error(); }});
class ShouldNotGetValueOf {}
assert.throws(ShouldNotGetValueOf, function() {
closable.take({ get valueOf() { throw new ShouldNotGetValueOf(); }});
});
assert.sameValue(closed, true);

0 comments on commit 652ac6c

Please sign in to comment.