OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 (function StoreToSuper () { | |
6 "use strict"; | |
arv (Not doing code reviews)
2015/05/12 17:16:34
indentation is still borked. 1 space here and tabs
| |
7 class A { | |
8 s() { | |
9 super.bla = 10; | |
10 } | |
11 }; | |
12 | |
13 let a = new A(); | |
14 (new A).s.call(a); | |
15 assertEquals(10, a.bla); | |
16 assertThrows(function() { (new A).s.call(undefined); }, TypeError); | |
17 assertThrows(function() { (new A).s.call(42); }, TypeError); | |
18 assertThrows(function() { (new A).s.call(null); }, TypeError); | |
19 assertThrows(function() { (new A).s.call("abc"); }, TypeError); | |
20 })(); | |
21 | |
22 | |
23 (function LoadFromSuper () { | |
24 "use strict"; | |
25 class A { | |
26 s() { | |
27 return super.bla; | |
28 } | |
29 }; | |
30 | |
31 let a = new A(); | |
32 assertSame(undefined, (new A).s.call(a)); | |
33 assertSame(undefined, (new A).s.call(undefined)); | |
34 assertSame(undefined, (new A).s.call(42)); | |
35 assertSame(undefined, (new A).s.call(null)); | |
36 assertSame(undefined, (new A).s.call("abc")); | |
37 })(); | |
OLD | NEW |