File size: 1,137 Bytes
1abfaca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | function test() {
var str = [];
var i;
for (i = 0; i < 1024; i++) {
str.push(String.fromCharCode(i & 0xffff));
}
str = str.join('');
/* Because this testcase is not about interning, intern the substrings
* to avoid string table traffic in this particular test.
*/
var dummy = [
str.charCodeAt(0),
str.charCodeAt(1023),
str.charCodeAt(100),
str.charCodeAt(200),
str.charCodeAt(300),
str.charCodeAt(400),
str.charCodeAt(900),
str.charCodeAt(800),
str.charCodeAt(700),
str.charCodeAt(600),
str.charCodeAt(500)
];
for (i = 0; i < 1e6; i++) {
void str.charCodeAt(0);
void str.charCodeAt(1023);
void str.charCodeAt(100);
void str.charCodeAt(200);
void str.charCodeAt(300);
void str.charCodeAt(400);
void str.charCodeAt(900);
void str.charCodeAt(800);
void str.charCodeAt(700);
void str.charCodeAt(600);
void str.charCodeAt(500);
}
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}
|