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

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

Issue 1812143004: Revert of Restore per-TypedArray-class length accessors as a perf workaround (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « src/js/typedarray.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Test that the methods for different TypedArray types have the same 5 // Test that the methods for different TypedArray types have the same
6 // identity. 6 // identity.
7 7
8 'use strict'; 8 'use strict';
9 9
10 let typedArrayConstructors = [ 10 let typedArrayConstructors = [
(...skipping 10 matching lines...) Expand all
21 let TypedArray = Uint8Array.__proto__; 21 let TypedArray = Uint8Array.__proto__;
22 let TypedArrayPrototype = TypedArray.prototype; 22 let TypedArrayPrototype = TypedArray.prototype;
23 23
24 assertEquals(TypedArray.__proto__, Function.prototype); 24 assertEquals(TypedArray.__proto__, Function.prototype);
25 assertEquals(TypedArrayPrototype.__proto__, Object.prototype); 25 assertEquals(TypedArrayPrototype.__proto__, Object.prototype);
26 26
27 // There are extra own class properties due to it simply being a function 27 // There are extra own class properties due to it simply being a function
28 let classProperties = new Set([ 28 let classProperties = new Set([
29 "length", "name", "arguments", "caller", "prototype", "BYTES_PER_ELEMENT" 29 "length", "name", "arguments", "caller", "prototype", "BYTES_PER_ELEMENT"
30 ]); 30 ]);
31 let instanceProperties = new Set([ 31 let instanceProperties = new Set(["BYTES_PER_ELEMENT", "constructor", "prototype "]);
32 "BYTES_PER_ELEMENT", "constructor", "prototype",
33 // length is also an instance property as a temporary workaround to
34 // BUG(chromium:579905). TODO(littledan): remove the workaround
35 "length"
36 ]);
37 32
38 function functionProperties(object) { 33 function functionProperties(object) {
39 return Object.getOwnPropertyNames(object).filter(function(name) { 34 return Object.getOwnPropertyNames(object).filter(function(name) {
40 return typeof Object.getOwnPropertyDescriptor(object, name).value 35 return typeof Object.getOwnPropertyDescriptor(object, name).value
41 == "function" && name != 'constructor'; 36 == "function"
37 && name != 'constructor' && name != 'subarray';
42 }); 38 });
43 } 39 }
44 40
45 let typedArrayMethods = functionProperties(Uint8Array.prototype); 41 let typedArrayMethods = functionProperties(Uint8Array.prototype);
46 let typedArrayClassMethods = functionProperties(Uint8Array); 42 let typedArrayClassMethods = functionProperties(Uint8Array);
47 43
48 for (let constructor of typedArrayConstructors) { 44 for (let constructor of typedArrayConstructors) {
49 for (let property of Object.getOwnPropertyNames(constructor.prototype)) { 45 for (let property of Object.getOwnPropertyNames(constructor.prototype)) {
50 assertTrue(instanceProperties.has(property), property); 46 assertTrue(instanceProperties.has(property), property);
51 } 47 }
(...skipping 13 matching lines...) Expand all
65 assertFalse(desc.writable); 61 assertFalse(desc.writable);
66 assertFalse(desc.configurable); 62 assertFalse(desc.configurable);
67 assertFalse(desc.enumerable); 63 assertFalse(desc.enumerable);
68 64
69 for (let constructor of typedArrayConstructors) { 65 for (let constructor of typedArrayConstructors) {
70 let desc = Object.getOwnPropertyDescriptor(constructor, "prototype"); 66 let desc = Object.getOwnPropertyDescriptor(constructor, "prototype");
71 assertFalse(desc.writable); 67 assertFalse(desc.writable);
72 assertFalse(desc.configurable); 68 assertFalse(desc.configurable);
73 assertFalse(desc.enumerable); 69 assertFalse(desc.enumerable);
74 } 70 }
OLDNEW
« no previous file with comments | « src/js/typedarray.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698