From 915f7e79be882d3149efd69ac5ef8db7b7cfa691 Mon Sep 17 00:00:00 2001 From: Wenlu Wang Date: Tue, 27 Jul 2021 18:17:50 +0800 Subject: [PATCH] Fix incorrect case --- .../Array/prototype/findLast/array-altered-during-loop.js | 2 +- .../prototype/findLastIndex/array-altered-during-loop.js | 2 +- .../prototype/findLast/BigInt/predicate-call-changes-value.js | 4 ++-- .../prototype/findLast/predicate-call-changes-value.js | 4 ++-- .../findLastIndex/BigInt/predicate-call-changes-value.js | 2 +- .../prototype/findLastIndex/predicate-call-changes-value.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/built-ins/Array/prototype/findLast/array-altered-during-loop.js b/test/built-ins/Array/prototype/findLast/array-altered-during-loop.js index 674d7771fe..dd4ab34404 100644 --- a/test/built-ins/Array/prototype/findLast/array-altered-during-loop.js +++ b/test/built-ins/Array/prototype/findLast/array-altered-during-loop.js @@ -36,7 +36,7 @@ arr = ['Skateboard', 'Barefoot']; arr.findLast(function(kValue) { if (results.length === 0) { arr.push('Motorcycle'); - arr[1] = 'Magic Carpet'; + arr[0] = 'Magic Carpet'; } results.push(kValue); diff --git a/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js b/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js index 26492add5a..6245cfa9cf 100644 --- a/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js +++ b/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js @@ -36,7 +36,7 @@ arr = ['Skateboard', 'Barefoot']; arr.findLastIndex(function(kValue) { if (results.length === 0) { arr.push('Motorcycle'); - arr[1] = 'Magic Carpet'; + arr[0] = 'Magic Carpet'; } results.push(kValue); diff --git a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-call-changes-value.js index 1f9c93fd0e..9c4496c762 100644 --- a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-call-changes-value.js +++ b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-call-changes-value.js @@ -44,7 +44,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { if ( i === 2 ) { sample[0] = 7n; } - return val === 3n; + return val === 1n; }); assert.sameValue(result, undefined, "value not found"); @@ -62,5 +62,5 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample[2] = 7n; return true; }); - assert.sameValue(result, 1n, "findLast() returns previous found value"); + assert.sameValue(result, 3n, "findLast() returns previous found value"); }); diff --git a/test/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js index 0b847866a6..7fc08ab8c6 100644 --- a/test/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js +++ b/test/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js @@ -44,7 +44,7 @@ testWithTypedArrayConstructors(function(TA) { if ( i === 2 ) { sample[0] = 7; } - return val === 3; + return val === 1; }); assert.sameValue(result, undefined, "value not found"); @@ -62,5 +62,5 @@ testWithTypedArrayConstructors(function(TA) { sample[2] = 7; return true; }); - assert.sameValue(result, 1, "findLast() returns previous found value"); + assert.sameValue(result, 3, "findLast() returns previous found value"); }); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-call-changes-value.js index 4a02b43ffd..6fe27a8b5b 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-call-changes-value.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-call-changes-value.js @@ -43,7 +43,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { if ( i === 2 ) { sample[0] = 7n; } - return val === 30n; + return val === 10n; }); assert.sameValue(result, -1, "value not found"); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js index 278ec19023..5449cc1ba0 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js @@ -43,7 +43,7 @@ testWithTypedArrayConstructors(function(TA) { if ( i === 2 ) { sample[0] = 7; } - return val === 30; + return val === 10; }); assert.sameValue(result, -1, "value not found");