diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js index cfb3f92f31..346830325b 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js @@ -1,4 +1,5 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. +// Copyright (C) 2021 Apple Inc. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-%typedarray%.prototype.filter @@ -22,11 +23,14 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(2); sample.filter(function() { + var flag = true; if (loops === 0) { $DETACHBUFFER(sample.buffer); + } else { + flag = false; } loops++; - return true; + return flag; }); assert.sameValue(loops, 2); diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js index 80078b3fe7..bfb837d23f 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js @@ -1,4 +1,5 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. +// Copyright (C) 2021 Apple Inc. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-%typedarray%.prototype.findindex @@ -36,16 +37,12 @@ features: [BigInt, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(2); var loops = 0; - var completion = false; - assert.throws(TypeError, function() { - sample.findIndex(function() { - loops++; + sample.findIndex(function() { + if (loops === 0) { $DETACHBUFFER(sample.buffer); - completion = true; - }); - }, "throws a TypeError getting a value from the detached buffer"); - - assert.sameValue(loops, 1, "predicated is called once"); - assert(completion, "abrupt completion does not come from DETACHBUFFER"); + } + loops++; + }); + assert.sameValue(loops, 2, "predicate is called once"); });