summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/class/superPropBasicCalls.js
blob: c05d0ec26c5a11ccf01a24b9f5e6fdcfc92b24df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Super property (and calls) works in non-extending classes and object
// litterals.
class toStringTest {
    constructor() {
        // Install a property to make it plausible that it's the same this
        this.foo = "rhinoceros";
    }

    test() {
        assertEq(super.toString(), super["toString"]());
        assertEq(super.toString(), this.toString());
    }
}

new toStringTest().test();

let toStrOL = {
    test() {
        assertEq(super.toString(), super["toString"]());
        assertEq(super.toString(), this.toString());
    }
}

toStrOL.test();

if (typeof reportCompare === 'function')
    reportCompare(0,0,"OK");