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-spread-calls --harmony-destructuring | 6 // Flags: --harmony-spread-calls --harmony-destructuring |
7 // Flags: --harmony-rest-parameters --harmony-sloppy | 7 // Flags: --harmony-rest-parameters --harmony-sloppy |
8 | 8 |
9 (function TestSuperNamedLoads() { | 9 (function TestSuperNamedLoads() { |
10 function Base() { } | 10 function Base() { } |
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 new F(); | 2014 new F(); |
2015 assertEquals(1, calls); | 2015 assertEquals(1, calls); |
2016 }()); | 2016 }()); |
2017 | 2017 |
2018 | 2018 |
2019 (function TestExtendsObject() { | 2019 (function TestExtendsObject() { |
2020 'use strict'; | 2020 'use strict'; |
2021 class F extends Object { } | 2021 class F extends Object { } |
2022 var f = new F(42); | 2022 var f = new F(42); |
2023 | 2023 |
2024 // TODO(dslomov,arv): Fix this. BUG=v8:3886. | 2024 assertInstanceof(f, F); |
2025 assertInstanceof(f, Number); | 2025 assertInstanceof(f, Object); |
2026 }()); | 2026 }()); |
2027 | 2027 |
2028 | 2028 |
2029 (function TestSuperCallErrorCases() { | 2029 (function TestSuperCallErrorCases() { |
2030 'use strict'; | 2030 'use strict'; |
2031 class T extends Object { | 2031 class T extends Object { |
2032 constructor() { | 2032 constructor() { |
2033 super(); | 2033 super(); |
2034 } | 2034 } |
2035 } | 2035 } |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 } | 2250 } |
2251 class Derived extends Base { | 2251 class Derived extends Base { |
2252 constructor(x) { | 2252 constructor(x) { |
2253 let r = (() => super(...[x]))(); | 2253 let r = (() => super(...[x]))(); |
2254 assertEquals(this, r); | 2254 assertEquals(this, r); |
2255 } | 2255 } |
2256 } | 2256 } |
2257 let d = new Derived(42); | 2257 let d = new Derived(42); |
2258 assertSame(42, d.x); | 2258 assertSame(42, d.x); |
2259 })(); | 2259 })(); |
OLD | NEW |