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-collections --allow-natives-syntax | 5 // Flags: --allow-natives-syntax |
6 | 6 |
7 | 7 |
8 (function TestSetIterator() { | 8 (function TestSetIterator() { |
9 var s = new Set; | 9 var s = new Set; |
10 var iter = s.values(); | 10 var iter = s.values(); |
11 assertEquals('Set Iterator', %_ClassOf(iter)); | 11 assertEquals('Set Iterator', %_ClassOf(iter)); |
12 | 12 |
13 var SetIteratorPrototype = iter.__proto__; | 13 var SetIteratorPrototype = iter.__proto__; |
14 assertFalse(SetIteratorPrototype.hasOwnProperty('constructor')); | 14 assertFalse(SetIteratorPrototype.hasOwnProperty('constructor')); |
15 assertEquals(SetIteratorPrototype.__proto__, Object.prototype); | 15 assertEquals(SetIteratorPrototype.__proto__, Object.prototype); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 (function TestMapIteratorSymbol() { | 192 (function TestMapIteratorSymbol() { |
193 assertEquals(Map.prototype[Symbol.iterator], Map.prototype.entries); | 193 assertEquals(Map.prototype[Symbol.iterator], Map.prototype.entries); |
194 assertTrue(Map.prototype.hasOwnProperty(Symbol.iterator)); | 194 assertTrue(Map.prototype.hasOwnProperty(Symbol.iterator)); |
195 assertFalse(Map.prototype.propertyIsEnumerable(Symbol.iterator)); | 195 assertFalse(Map.prototype.propertyIsEnumerable(Symbol.iterator)); |
196 | 196 |
197 var iter = new Map().values(); | 197 var iter = new Map().values(); |
198 assertEquals(iter, iter[Symbol.iterator]()); | 198 assertEquals(iter, iter[Symbol.iterator]()); |
199 assertEquals(iter[Symbol.iterator].name, '[Symbol.iterator]'); | 199 assertEquals(iter[Symbol.iterator].name, '[Symbol.iterator]'); |
200 })(); | 200 })(); |
OLD | NEW |