| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-arrays | |
| 6 | |
| 7 // Test that the methods for different TypedArray types have the same | 5 // Test that the methods for different TypedArray types have the same |
| 8 // identity. | 6 // identity. |
| 9 // TODO(dehrenberg): Test that the TypedArray proto hierarchy is set | 7 // TODO(dehrenberg): Test that the TypedArray proto hierarchy is set |
| 10 // up properly. | 8 // up properly. |
| 11 // TODO(dehrenberg): subarray is currently left out because that still | 9 // TODO(dehrenberg): subarray is currently left out because that still |
| 12 // uses per-type methods. When that's fixed, stop leaving it out. | 10 // uses per-type methods. When that's fixed, stop leaving it out. |
| 13 | 11 |
| 14 var typedArrayConstructors = [ | 12 var typedArrayConstructors = [ |
| 15 Uint8Array, | 13 Uint8Array, |
| 16 Int8Array, | 14 Int8Array, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 35 | 33 |
| 36 for (var constructor of typedArrayConstructors) { | 34 for (var constructor of typedArrayConstructors) { |
| 37 for (var method of typedArrayMethods) { | 35 for (var method of typedArrayMethods) { |
| 38 assertEquals(constructor.prototype[method], | 36 assertEquals(constructor.prototype[method], |
| 39 Uint8Array.prototype[method], method); | 37 Uint8Array.prototype[method], method); |
| 40 } | 38 } |
| 41 for (var classMethod of typedArrayClassMethods) { | 39 for (var classMethod of typedArrayClassMethods) { |
| 42 assertEquals(constructor[method], Uint8Array[method], classMethod); | 40 assertEquals(constructor[method], Uint8Array[method], classMethod); |
| 43 } | 41 } |
| 44 } | 42 } |
| OLD | NEW |