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: --allow-natives-syntax | 5 // Flags: --allow-natives-syntax |
6 // Flags: --harmony-sloppy | |
7 | 6 |
8 (function TestSuperNamedLoads() { | 7 (function TestSuperNamedLoads() { |
9 function Base() { } | 8 function Base() { } |
10 function fBase() { } | 9 function fBase() { } |
11 Base.prototype = { | 10 Base.prototype = { |
12 f() { | 11 f() { |
13 return "Base " + this.toString(); | 12 return "Base " + this.toString(); |
14 }, | 13 }, |
15 x: 15, | 14 x: 15, |
16 toString() { | 15 toString() { |
(...skipping 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 } | 2206 } |
2208 class Derived extends Base { | 2207 class Derived extends Base { |
2209 constructor(x) { | 2208 constructor(x) { |
2210 let r = (() => super(...[x]))(); | 2209 let r = (() => super(...[x]))(); |
2211 assertEquals(this, r); | 2210 assertEquals(this, r); |
2212 } | 2211 } |
2213 } | 2212 } |
2214 let d = new Derived(42); | 2213 let d = new Derived(42); |
2215 assertSame(42, d.x); | 2214 assertSame(42, d.x); |
2216 })(); | 2215 })(); |
OLD | NEW |