diff --git a/test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js b/test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js index f9547f72a4..cc8367df12 100644 --- a/test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js +++ b/test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js @@ -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); diff --git a/test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js b/test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js index b09184386f..7c9d4a3264 100644 --- a/test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js +++ b/test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js @@ -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);