| 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 // Flags: --harmony-iteration | |
| 6 | |
| 7 | 5 |
| 8 var constructors = [Uint8Array, Int8Array, | 6 var constructors = [Uint8Array, Int8Array, |
| 9 Uint16Array, Int16Array, | 7 Uint16Array, Int16Array, |
| 10 Uint32Array, Int32Array, | 8 Uint32Array, Int32Array, |
| 11 Float32Array, Float64Array, | 9 Float32Array, Float64Array, |
| 12 Uint8ClampedArray]; | 10 Uint8ClampedArray]; |
| 13 | 11 |
| 14 function TestTypedArrayPrototype(constructor) { | 12 function TestTypedArrayPrototype(constructor) { |
| 15 assertTrue(constructor.prototype.hasOwnProperty('entries')); | 13 assertTrue(constructor.prototype.hasOwnProperty('entries')); |
| 16 assertTrue(constructor.prototype.hasOwnProperty('values')); | 14 assertTrue(constructor.prototype.hasOwnProperty('values')); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 32 | 30 |
| 33 function TestTypedArrayValues(constructor) { | 31 function TestTypedArrayValues(constructor) { |
| 34 var array = [1, 2, 3]; | 32 var array = [1, 2, 3]; |
| 35 var i = 0; | 33 var i = 0; |
| 36 for (var value of new constructor(array)) { | 34 for (var value of new constructor(array)) { |
| 37 assertEquals(array[i++], value); | 35 assertEquals(array[i++], value); |
| 38 } | 36 } |
| 39 assertEquals(i, array.length); | 37 assertEquals(i, array.length); |
| 40 } | 38 } |
| 41 constructors.forEach(TestTypedArrayValues); | 39 constructors.forEach(TestTypedArrayValues); |
| OLD | NEW |