Debian Codegraph @

js/src/jit-test/tests/cacheir/bug1651732-ionic-getprop-super.js

raw
1 class Base {
2 static a = 0;
3 static [Symbol.iterator] = 0;
4 }
5
6 class Derived extends Base {
7 static m(key) {
8 // Attach an IC through IonGetPropSuperIC.
9 return super[key];
10 }
11 }
12
13 var key = {
14 value: "a",
15
16 [Symbol.toPrimitive]() {
17 return this.value;
18 }
19 };
20
21 for (var i = 0; i < 100; ++i) {
22 // Change key[Symbol.toPrimitive] to return a symbol after some warm-up.
23 if (i > 80) {
24 key.value = Symbol.iterator;
25 }
26
27 assertEq(Derived.m(key), 0);
28 }