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