Debian Codegraph @

js/src/tests/test262/language/statements/class/super/in-constructor.js

raw
1 // Copyright (C) 2014 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-makesuperpropertyreference
5 description: >
6 class super in constructor
7 ---*/
8 var calls = 0;
9 class B {}
10 B.prototype.x = 42;
11
12 class C extends B {
13 constructor() {
14 super();
15 calls++;
16 assert.sameValue(super.x, 42, "The value of `super.x` is `42`");
17 }
18 }
19
20 new C;
21 assert.sameValue(calls, 1, "The value of `calls` is `1`");
22
23 reportCompare(0, 0);