summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/superElemMegamorphic.js
blob: 8601cc472a50a4e87e7ff1a666dfc60f7095582e (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
29
30
31
32
33
class C { };
C.prototype.a = "a";
C.prototype.b = "b";
C.prototype.c = "c";
C.prototype.d = "d";
C.prototype.e = "e";
C.prototype.f = "f";
C.prototype.g = "g";
C.prototype.h = "h";
C.prototype.i = "i";
C.prototype.j = "j";
C.prototype.k = "k";
C.prototype.l = "l";
C.prototype.m = "m";
C.prototype.n = "n";
C.prototype.o = "o";
C.prototype.p = "p";
C.prototype.q = "q";
C.prototype.r = "r";

class D extends C {
    foo(p) {
        return super[p];
    }
}

var d = new D();

for (let i = 0; i < 20; ++i) {
    for (let p in C.prototype) {
        assertEq(p, d.foo(p));
    }
}