Debian Codegraph @

js/src/jit-test/tests/basic/str-atom-cache-extensible.js

raw
1 // Create an extensible string.
2 var extensible = "foo".repeat(50);
3 extensible += "bar";
4 extensible.indexOf("X");
5
6 // Ensure it's in the StringToAtomCache.
7 var obj = {};
8 obj[extensible] = 1;
9
10 // Make it a dependent string.
11 var other = extensible + "baz";
12 other.indexOf("X");
13
14 // Must still be in the cache.
15 obj[extensible] = 1;