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-reflect | 5 // Flags: --harmony-reflect |
6 | 6 |
7 | 7 |
8 (function testReflectConstructArity() { | 8 (function testReflectConstructArity() { |
9 assertEquals(2, Reflect.construct.length); | 9 assertEquals(2, Reflect.construct.length); |
10 })(); | 10 })(); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 ["T", "E", "S", "T", "!", "!"]).a); | 268 ["T", "E", "S", "T", "!", "!"]).a); |
269 assertEquals(10, Reflect.construct(sumStrict, | 269 assertEquals(10, Reflect.construct(sumStrict, |
270 { 0: 1, 1: 2, 2: 3, 3: 4, length: 4 }).a); | 270 { 0: 1, 1: 2, 2: 3, 3: 4, length: 4 }).a); |
271 assertEquals("TEST", Reflect.construct(sumSloppy, | 271 assertEquals("TEST", Reflect.construct(sumSloppy, |
272 ["T", "E", "S", "T"]).a); | 272 ["T", "E", "S", "T"]).a); |
273 assertEquals("TEST!!", Reflect.construct(sumSloppy, | 273 assertEquals("TEST!!", Reflect.construct(sumSloppy, |
274 ["T", "E", "S", "T", "!", "!"]).a); | 274 ["T", "E", "S", "T", "!", "!"]).a); |
275 assertEquals(10, Reflect.construct(sumSloppy, | 275 assertEquals(10, Reflect.construct(sumSloppy, |
276 { 0: 1, 1: 2, 2: 3, 3: 4, length: 4 }).a); | 276 { 0: 1, 1: 2, 2: 3, 3: 4, length: 4 }).a); |
277 })(); | 277 })(); |
| 278 |
| 279 (function() { |
| 280 function* f() { yield 1; yield 2; } |
| 281 function* g() { yield 3; yield 4; } |
| 282 var o = Reflect.construct(f, [], g); |
| 283 assertEquals([1, 2], [...o]); |
| 284 assertTrue(o.__proto__ === g.prototype); |
| 285 assertTrue(o.__proto__ !== f.prototype); |
| 286 })(); |
OLD | NEW |