Debian Codegraph @

js/src/jit-test/tests/latin1/bug1033113.js

raw
1 var s = "aaaaaaaaaaaaaaaaaa111aaaa";
2 var latin1Rope1 = "foo" + s;
3 var latin1Rope2 = "bar" + latin1Rope1;
4 var twoByteRope = "\u1200--" + latin1Rope1;
5
6 // Flatten twoByteRope.
7 assertEq(twoByteRope.lastIndexOf("11"), 25);
8
9 // latin1Rope1 is now a TwoByte dependent string.
10 assertEq(isLatin1(latin1Rope1), false);
11 assertEq(latin1Rope1, "fooaaaaaaaaaaaaaaaaaa111aaaa");
12
13 // latin1Rope2 should still be Latin1, but now has a
14 // TwoByte descendent (latin1Rope1).
15 if (isLatin1(s))
16 assertEq(isLatin1(latin1Rope2), true);
17
18 // Flatten latin1Rope2.
19 assertEq(latin1Rope2.lastIndexOf("11"), 25);
20 assertEq(latin1Rope2, "barfooaaaaaaaaaaaaaaaaaa111aaaa");