summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/fields/private-method-static.js
blob: 17b5f1e130b9a9f1a00f47db0d8460c5b93f5b66 (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
28
class B {
    static #smethod() {
        return 14;
    }

    static f() {
        return this.#smethod();
    }
}
assertEq(B.f(), 14);



class OuterStatic {
    static #outerMethod() { return "ok"; }

    static test() {
        class Inner {
            #innerMethod() { }
            static test(outer) {
                return outer.#outerMethod();
            }
        }
        return Inner.test(this);
    }
}
assertEq(OuterStatic.test(), "ok");