# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. 10 1,1,0,0,1,1 100 ,,0,0, 5 1,2,3,4,5 4 1,2,3,4 4 1,2,3,3 5 2,3,4,5,6 5,4,3,2,1 10 undefined undefined undefined 8 undefined 9 0 9 2 1 undefined 9 2 undefined 1 9 10 1 2 3 4 5 undefined undefined undefined undefined undefined 9 10 undefined undefined undefined undefined undefined undefined undefined 1 2 3 16 6 -1 The NewTarget is undefined undefined 1 6 6 undefined 2 2 6,,4,3,2,1 1,2,3,4,,6 1,2,6,4,5 1,2,3,4,5 Dec,Feb,Jan,Mar Mar,Jan,Feb,Dec 1,2,10,21 1,10,21,2 5,4,3,2,,0 ======== Begin: Array.prototype.reverse() ======== arr0.reverse() === arr0 ? true arr0.length after reverse() called = 0 arr1.reverse() === arr1 ? true arr1 after reverse() called = 1 arrWithHoles before reverse() called = ,1,,,4,,,,, arrWithHoles.reverse() = ,,,,,4,,,1, arrWithHoles after reverse() called = ,,,,,4,,,1, ======== End: Array.prototype.reverse() ======== ======== Begin: Array.prototype.indexOf() & Array.prototype.lastIndexOf() ======== arr = [0, 10, 20, 80, 40, Hole, undefined, 10, "80", Hole] Group 1: 0 <= fromIndex < arr.length: 4,-1,1,7,4,-1,7,1 Group 2: -arr.length <= fromIndex < 0: -1,4,7,1,4,-1,1,-1,0,1,0,-1 Group 3: fromIndex >= arr.length: -1,-1,-1,-1,0,0 Group 4: fromIndex < -arr.length: 0,-1 Group 5: fromIndex in [Infinity, -Infinity]: 1,-1,-1,7 Group 6: fromIndex is NaN: 0,1,0,-1 Group 7: fromIndex is not of type 'number': 7,1,7,7 Group 8: Strict equality checking: 8,3 Group 9: Searching undefined and null: 6,6,-1,6,6,-1 Group 10: fromIndex with side effects: - indexOf: result = -1, accessCount = 6 - lastIndexOf: result = -1, accesscount = 6 Group 11: fromIndex that triggers exceptions: Expected TypeError caught in indexOf when fromIndex is bigint. Expected TypeError caught in lastIndexOf when fromIndex is bigint. Expected TypeError caught in indexOf when fromIndex is symbol. Expected TypeError caught in lastIndexOf when fromIndex is symbol. ======== End: Array.prototype.indexOf() & Array.prototype.lastIndexOf() ======== CallbackFn is not callable ,,baz ,,baz {"0":-1.6304390272817058e+308,"length":1} constructor get [Symbol.species] constructor 1 1 0 0 constructor get [Symbol.species] constructor 1 1 0 0 constructor get [Symbol.species] constructor 1 1 0 0 constructor get [Symbol.species] constructor 1 1 0 0 false