Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: test/mjsunit/harmony/typedarray-proto.js

Issue 1215863003: Include Harmony Array/TypedArray methods unconditionally (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove the flag and move the tests Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/mjsunit/harmony/typedarray-iteration.js ('k') | test/mjsunit/harmony/typedarray-reduce.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --harmony-arrays
6
7 // Test that the methods for different TypedArray types have the same
8 // identity.
9 // TODO(dehrenberg): Test that the TypedArray proto hierarchy is set
10 // up properly.
11 // TODO(dehrenberg): subarray is currently left out because that still
12 // uses per-type methods. When that's fixed, stop leaving it out.
13
14 var typedArrayConstructors = [
15 Uint8Array,
16 Int8Array,
17 Uint16Array,
18 Int16Array,
19 Uint32Array,
20 Int32Array,
21 Uint8ClampedArray,
22 Float32Array,
23 Float64Array];
24
25 function functionProperties(object) {
26 return Object.getOwnPropertyNames(object).filter(function(name) {
27 return typeof Object.getOwnPropertyDescriptor(object, name).value
28 == "function"
29 && name != 'constructor' && name != 'subarray';
30 });
31 }
32
33 var typedArrayMethods = functionProperties(Uint8Array.prototype);
34 var typedArrayClassMethods = functionProperties(Uint8Array);
35
36 for (var constructor of typedArrayConstructors) {
37 for (var method of typedArrayMethods) {
38 assertEquals(constructor.prototype[method],
39 Uint8Array.prototype[method], method);
40 }
41 for (var classMethod of typedArrayClassMethods) {
42 assertEquals(constructor[method], Uint8Array[method], classMethod);
43 }
44 }
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/typedarray-iteration.js ('k') | test/mjsunit/harmony/typedarray-reduce.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698