OLD | NEW |
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 // Flags: --harmony-sloppy --harmony-rest-parameters | 5 // Flags: --harmony-sloppy |
6 | 6 |
7 | 7 |
8 (function testConstructClassStrict() { | 8 (function testConstructClassStrict() { |
9 "use strict"; | 9 "use strict"; |
10 class Base { | 10 class Base { |
11 constructor(...args) { | 11 constructor(...args) { |
12 this.baseArgs = args; | 12 this.baseArgs = args; |
13 } | 13 } |
14 method() { return this.baseArgs; } | 14 method() { return this.baseArgs; } |
15 } | 15 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 assertEquals([1, 2, 3], c.baseArgs); | 83 assertEquals([1, 2, 3], c.baseArgs); |
84 assertEquals([1, 2, 3], c.childArgs); | 84 assertEquals([1, 2, 3], c.childArgs); |
85 | 85 |
86 c = new Child2(...[1, 2, 3]); | 86 c = new Child2(...[1, 2, 3]); |
87 assertInstanceof(c, Child2); | 87 assertInstanceof(c, Child2); |
88 assertInstanceof(c, Base); | 88 assertInstanceof(c, Base); |
89 assertEquals(["extra", 1, 2, 3], c.method()); | 89 assertEquals(["extra", 1, 2, 3], c.method()); |
90 assertEquals(["extra", 1, 2, 3], c.baseArgs); | 90 assertEquals(["extra", 1, 2, 3], c.baseArgs); |
91 assertEquals([1, 2, 3], c.childArgs); | 91 assertEquals([1, 2, 3], c.childArgs); |
92 })(); | 92 })(); |
OLD | NEW |