Lines Matching refs:Array
6 // https://github.com/tc39/Array.prototype.includes/tree/master/test
10 // Array.prototype.includes sees a new element added by a getter that is hit
23 assertTrue(Array.prototype.includes.call(arrayLike, "c"));
27 // Array.prototype.includes works on array-like objects
35 assertTrue(Array.prototype.includes.call(arrayLike1, "a"));
36 assertFalse(Array.prototype.includes.call(arrayLike1, "c"));
45 assertTrue(Array.prototype.includes.call(arrayLike2, "b"));
46 assertFalse(Array.prototype.includes.call(arrayLike2, "c"));
50 // Array.prototype.includes should fail if used on a null or undefined this
53 Array.prototype.includes.call(null, "a");
57 Array.prototype.includes.call(undefined, "a");
62 // Array.prototype.includes should terminate if getting an index throws an
80 Array.prototype.includes.call(trappedZero, "a");
85 // Array.prototype.includes should terminate if ToNumber ends up being called on
97 Array.prototype.includes.call(trappedZero, "a", Symbol());
102 // Array.prototype.includes should terminate if an exception occurs converting
122 Array.prototype.includes.call(trappedZero, "a", fromIndex);
127 // Array.prototype.includes should terminate if an exception occurs getting the
149 Array.prototype.includes.call(throwingLength, "a", fromIndexTrap);
154 // Array.prototype.includes should terminate if ToLength ends up being called on
172 Array.prototype.includes.call(badLength, "a", fromIndexTrap);
177 // Array.prototype.includes should terminate if an exception occurs converting
201 Array.prototype.includes.call(badLength, "a", fromIndexTrap);
206 // Array.prototype.includes should search the whole array, as the optional
224 assertTrue(Array.prototype.includes.call(arrayLike, "1"));
225 assertTrue(Array.prototype.includes.call(arrayLike, "2"));
229 // Array.prototype.includes returns false if fromIndex is greater or equal to
230 // the length of the array
247 assertFalse(Array.prototype.includes.call(arrayLikeWithTrap, "c", 2));
248 assertFalse(Array.prototype.includes.call(arrayLikeWithTrap, "c", 3));
252 // Array.prototype.includes searches the whole array if the computed index from
271 assertTrue(Array.prototype.includes.call(arrayLike, "a", -4));
272 assertTrue(Array.prototype.includes.call(arrayLike, "b", -4));
276 // Array.prototype.includes should use a negative value as the offset from the
277 // end of the array to compute fromIndex
295 assertTrue(Array.prototype.includes.call(arrayLike, "b", -1));
296 assertFalse(Array.prototype.includes.call(arrayLike, "a", -1));
297 assertTrue(Array.prototype.includes.call(arrayLike, "a", -2));
301 // Array.prototype.includes converts its fromIndex parameter to an integer
317 assertFalse(Array.prototype.includes.call(arrayLikeWithTraps, "c", 2.1));
318 assertFalse(Array.prototype.includes.call(arrayLikeWithTraps, "c", +Infinity));
335 assertTrue(Array.prototype.includes.call(arrayLikeWithTrapAfterZero, "a", NaN));
350 // Array.prototype.includes should have length 1
352 assertEquals(1, Array.prototype.includes.length);
356 // Array.prototype.includes should have name property with value 'includes'
358 assertEquals("includes", Array.prototype.includes.name);
367 // Array.prototype.includes does not skip holes; if the array has a prototype it
376 holesEverywhere.__proto__.__proto__ = Array.prototype;
386 assertTrue(Array.prototype.includes.call(oneHole, "c"));
390 // Array.prototype.includes does not skip holes; instead it treates them as
398 // Array.prototype.includes gets length property from the prototype if it's
414 assertTrue(Array.prototype.includes.call(arrayLike, "a"));
418 // Array.prototype.includes treats a missing length property as zero
430 assertFalse(Array.prototype.includes.call(arrayLikeWithTraps, "a"));
434 // Array.prototype.includes should always return false on negative-length
437 assertFalse(Array.prototype.includes.call({
441 assertFalse(Array.prototype.includes.call({
445 assertFalse(Array.prototype.includes.call({
449 assertFalse(Array.prototype.includes.call({
453 assertFalse(Array.prototype.includes.call({
458 assertFalse(Array.prototype.includes.call({
463 assertFalse(Array.prototype.includes.call({
476 assertFalse(Array.prototype.includes.call(arrayLikeWithTrap, 2));
480 // Array.prototype.includes should clamp positive lengths to 2^53 - 1
484 assertFalse(Array.prototype.includes.call({
488 assertTrue(Array.prototype.includes.call({
493 assertTrue(Array.prototype.includes.call({
498 assertFalse(Array.prototype.includes.call({
513 Array.prototype.includes.call(arrayLikeWithTrap, "a", fromIndexForLargeIndexTests)
522 Array.prototype.includes.call(arrayLikeWithTooBigLength, "a", fromIndexForLargeIndexTests)
527 // Array.prototype.includes should always return false on zero-length objects
534 assertFalse(Array.prototype.includes.call({
538 assertFalse(Array.prototype.includes.call({
542 assertFalse(Array.prototype.includes.call({
546 assertFalse(Array.prototype.includes.call({
550 assertFalse(Array.prototype.includes.call({
555 assertFalse(Array.prototype.includes.call({
560 assertFalse(Array.prototype.includes.call({
565 assertFalse(Array.prototype.includes.call({
578 Array.prototype.includes.call(arrayLikeWithTrap);
582 assertUnreachable("Should not try to convert fromIndex to a number on a zero-length array");
588 Array.prototype.includes.call({
594 // Array.prototype.includes works on objects
613 // Array.prototype.includes does not see an element removed by a getter that is
628 assertFalse(Array.prototype.includes.call(arrayLike, "c"));
632 // Array.prototype.includes should use the SameValueZero algorithm to compare
648 // Array.prototype.includes stops once it hits the length of an array-like, even
661 assertFalse(Array.prototype.includes.call(arrayLike, "c"));
665 // Array.prototype.includes works on typed arrays
667 assertTrue(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 2));
670 Array.prototype.includes.call(new Float32Array([2.5, 3.14, Math.PI]), 3.1415927410125732)
673 assertFalse(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 4));
674 assertFalse(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 2, 2));