summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/str-atom-cache-extensible.js
blob: bee8f138472d10156f9eca0510f2cbf4a2bad4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Create an extensible string.
var extensible = "foo".repeat(50);
extensible += "bar";
extensible.indexOf("X");

// Ensure it's in the StringToAtomCache.
var obj = {};
obj[extensible] = 1;

// Make it a dependent string.
var other = extensible + "baz";
other.indexOf("X");

// Must still be in the cache.
obj[extensible] = 1;