You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
480 B

/*
* Test JSON string parsing with various input lengths;
* exercises bufwriter handling, intended for asserts and
* valgrinding.
*/
/*===
done
===*/
function test() {
var str = '';
var tmp;
var i, j;
for (i = 0; i < 1024; i++) {
str += 'x';
tmp = JSON.stringify(str);
for (j = 0; j < 256; j++) {
void JSON.parse(tmp);
}
}
print('done');
}
try {
test();
} catch (e) {
print(e.stack || e);
}