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

Side by Side Diff: test/mjsunit/es6/typed-array-iterator.js

Issue 1780113002: Minor library function fixes for TypedArray spec compliance (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve comment 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') | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 var constructors = [Uint8Array, Int8Array, 6 var constructors = [Uint8Array, Int8Array,
7 Uint16Array, Int16Array, 7 Uint16Array, Int16Array,
8 Uint32Array, Int32Array, 8 Uint32Array, Int32Array,
9 Float32Array, Float64Array, 9 Float32Array, Float64Array,
10 Uint8ClampedArray]; 10 Uint8ClampedArray];
11 11
12 var TypedArrayPrototype = Uint8Array.prototype.__proto__; 12 var TypedArrayPrototype = Uint8Array.prototype.__proto__;
13 13
14 assertTrue(TypedArrayPrototype.hasOwnProperty('entries')); 14 assertTrue(TypedArrayPrototype.hasOwnProperty('entries'));
15 assertTrue(TypedArrayPrototype.hasOwnProperty('values')); 15 assertTrue(TypedArrayPrototype.hasOwnProperty('values'));
16 assertTrue(TypedArrayPrototype.hasOwnProperty('keys')); 16 assertTrue(TypedArrayPrototype.hasOwnProperty('keys'));
17 assertTrue(TypedArrayPrototype.hasOwnProperty(Symbol.iterator)); 17 assertTrue(TypedArrayPrototype.hasOwnProperty(Symbol.iterator));
18 18
19 assertFalse(TypedArrayPrototype.propertyIsEnumerable('entries')); 19 assertFalse(TypedArrayPrototype.propertyIsEnumerable('entries'));
20 assertFalse(TypedArrayPrototype.propertyIsEnumerable('values')); 20 assertFalse(TypedArrayPrototype.propertyIsEnumerable('values'));
21 assertFalse(TypedArrayPrototype.propertyIsEnumerable('keys')); 21 assertFalse(TypedArrayPrototype.propertyIsEnumerable('keys'));
22 assertFalse(TypedArrayPrototype.propertyIsEnumerable(Symbol.iterator)); 22 assertFalse(TypedArrayPrototype.propertyIsEnumerable(Symbol.iterator));
23 23
24 assertEquals(Array.prototype.entries, TypedArrayPrototype.entries); 24 assertFalse(Array.prototype.entries === TypedArrayPrototype.entries);
25 assertEquals(Array.prototype[Symbol.iterator], TypedArrayPrototype.values); 25 assertFalse(Array.prototype[Symbol.iterator] === TypedArrayPrototype.values);
26 assertEquals(Array.prototype.keys, TypedArrayPrototype.keys); 26 assertFalse(Array.prototype.keys === TypedArrayPrototype.keys);
27 assertEquals(Array.prototype[Symbol.iterator], TypedArrayPrototype[Symbol.iterat or]); 27 assertFalse(Array.prototype[Symbol.iterator] === TypedArrayPrototype[Symbol.iter ator]);
28 28
29 29
30 function TestTypedArrayValues(constructor) { 30 function TestTypedArrayValues(constructor) {
31 var array = [1, 2, 3]; 31 var array = [1, 2, 3];
32 var i = 0; 32 var i = 0;
33 for (var value of new constructor(array)) { 33 for (var value of new constructor(array)) {
34 assertEquals(array[i++], value); 34 assertEquals(array[i++], value);
35 } 35 }
36 assertEquals(i, array.length); 36 assertEquals(i, array.length);
37 } 37 }
38 constructors.forEach(TestTypedArrayValues); 38 constructors.forEach(TestTypedArrayValues);
OLDNEW
« no previous file with comments | « src/js/typedarray.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698