OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Largely ported from | 5 // Largely ported from |
6 // https://github.com/tc39/Array.prototype.includes/tree/master/test | 6 // https://github.com/tc39/Array.prototype.includes/tree/master/test |
7 // using https://www.npmjs.org/package/test262-to-mjsunit with further edits | 7 // using https://www.npmjs.org/package/test262-to-mjsunit with further edits |
8 | 8 |
9 | 9 |
10 // Array.prototype.includes sees a new element added by a getter that is hit | 10 // Array.prototype.includes sees a new element added by a getter that is hit |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 (function() { | 666 (function() { |
667 assertTrue(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 2)); | 667 assertTrue(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 2)); |
668 | 668 |
669 assertTrue( | 669 assertTrue( |
670 Array.prototype.includes.call(new Float32Array([2.5, 3.14, Math.PI]), 3.1415
927410125732) | 670 Array.prototype.includes.call(new Float32Array([2.5, 3.14, Math.PI]), 3.1415
927410125732) |
671 ); | 671 ); |
672 | 672 |
673 assertFalse(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 4)); | 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)); | 674 assertFalse(Array.prototype.includes.call(new Uint8Array([1, 2, 3]), 2, 2)); |
675 })(); | 675 })(); |
| 676 |
| 677 |
| 678 (function testUnscopable() { |
| 679 assertTrue(Array.prototype[Symbol.unscopables].includes); |
| 680 })(); |
OLD | NEW |