Debian Codegraph @

js/src/jit-test/tests/auto-regress/bug1448582-6.js

raw
1 // Overview:
2 // - The outer function is an IIFE which gets marked as a singleton.
3 // - The |o[index]| inner function is then also marked as a singleton.
4 // - The |o[index]| inner function has a dynamic name from a computed property name.
5 // - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function.
6
7 (function(index) {
8 var o = {
9 [index]: class {
10 constructor() {}
11
12 // The static method named "name" is added after assigning the
13 // inferred name.
14 static [(index === 0 ? "not-name" : "name")]() {}
15 }
16 }
17
18 // The inferred name matches the current index.
19 assertEq(displayName(o[index]), String(index));
20
21 if (index === 0) {
22 (function self() {
23 self.caller(1);
24 })();
25 }
26 })(0);