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 | |
6 | |
7 (function testCallSuperPropertyStrict() { | 5 (function testCallSuperPropertyStrict() { |
8 "use strict"; | 6 "use strict"; |
9 class BaseClass { | 7 class BaseClass { |
10 method(...args) { return [this].concat(args); } | 8 method(...args) { return [this].concat(args); } |
11 } | 9 } |
12 class SubClass extends BaseClass { | 10 class SubClass extends BaseClass { |
13 method(...args) { return super.method(...args); } | 11 method(...args) { return super.method(...args); } |
14 } | 12 } |
15 | 13 |
16 var c = new SubClass(); | 14 var c = new SubClass(); |
17 assertEquals([c, 1, 2, 3, 4, 5], c.method(1, 2, 3, 4, 5)); | 15 assertEquals([c, 1, 2, 3, 4, 5], c.method(1, 2, 3, 4, 5)); |
18 })(); | 16 })(); |
19 | 17 |
20 | 18 |
21 (function testCallSuperPropertySloppy() { | 19 (function testCallSuperPropertySloppy() { |
22 class BaseClass { | 20 class BaseClass { |
23 method(...args) { return [this].concat(args); } | 21 method(...args) { return [this].concat(args); } |
24 } | 22 } |
25 class SubClass extends BaseClass { | 23 class SubClass extends BaseClass { |
26 method(...args) { return super.method(...args); } | 24 method(...args) { return super.method(...args); } |
27 } | 25 } |
28 | 26 |
29 var c = new SubClass(); | 27 var c = new SubClass(); |
30 assertEquals([c, 1, 2, 3, 4, 5], c.method(1, 2, 3, 4, 5)); | 28 assertEquals([c, 1, 2, 3, 4, 5], c.method(1, 2, 3, 4, 5)); |
31 })(); | 29 })(); |
OLD | NEW |