Debian Codegraph @

js/src/tests/test262/language/statements/class/super/in-methods.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 methods
7 ---*/
8 class B {
9 method() {
10 return 1;
11 }
12 get x() {
13 return 2;
14 }
15 }
16 class C extends B {
17 method() {
18 assert.sameValue(super.x, 2, "The value of `super.x` is `2`");
19 return super.method();
20 }
21 }
22 assert.sameValue(new C().method(), 1, "`new C().method()` returns `1`");
23
24 reportCompare(0, 0);