mirror of https://github.com/svaarala/duktape.git
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.
120 lines
23 KiB
120 lines
23 KiB
/*---
|
|
{
|
|
"custom": true
|
|
}
|
|
---*/
|
|
|
|
/*===
|
|
{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":"bar"}}}}}}}}}}
|
|
{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":{"foo":"bar"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
|
|
RangeError
|
|
[[[[[[[[[["bar"]]]]]]]]]]
|
|
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["bar"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
|
|
RangeError
|
|
{"foo":[{"foo":[{"foo":[{"foo":[{"foo":["bar"]}]}]}]}]}
|
|
{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":[{"foo":["bar"]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}
|
|
RangeError
|
|
===*/
|
|
|
|
/* JSON stringify() recursion limit is hit if C recursion through object
|
|
* and/or array traversal becomes too deep.
|
|
*
|
|
* With shallow stacks a depth of >100 causes a problem, with deep stacks
|
|
* it takes >1000. Use a much larger value in the testcase.
|
|
*/
|
|
|
|
function objectRecursionTest(n) {
|
|
var obj = 'bar';
|
|
var i;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
obj = { foo: obj };
|
|
}
|
|
|
|
print(JSON.stringify(obj));
|
|
}
|
|
|
|
function arrayRecursionTest(n) {
|
|
var obj = 'bar';
|
|
var i;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
obj = [ obj ];
|
|
}
|
|
|
|
print(JSON.stringify(obj));
|
|
}
|
|
|
|
function objectAndArrayRecursionTest(n) {
|
|
var obj = 'bar';
|
|
var i;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
if (i % 2) {
|
|
obj = { foo: obj };
|
|
} else {
|
|
obj = [ obj ];
|
|
}
|
|
}
|
|
|
|
print(JSON.stringify(obj));
|
|
}
|
|
|
|
try {
|
|
objectRecursionTest(10);
|
|
objectRecursionTest(80);
|
|
objectRecursionTest(2000);
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
try {
|
|
arrayRecursionTest(10);
|
|
arrayRecursionTest(80);
|
|
arrayRecursionTest(2000);
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
try {
|
|
objectAndArrayRecursionTest(10);
|
|
objectAndArrayRecursionTest(80);
|
|
objectAndArrayRecursionTest(2000);
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
/*===
|
|
[{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}]]
|
|
[{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}]]
|
|
[{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}],{"foo":1,"bar":[1,2]},[1,{"foo":1}]]
|
|
===*/
|
|
|
|
/* A very wide structure is not an issue, as long as there is no (C)
|
|
* recursion. This test ensures that the recursion tracking works
|
|
* correctly, i.e. is increased and decreased where appropriate.
|
|
*/
|
|
|
|
function noRecursionTest(n) {
|
|
var obj = [];
|
|
var i;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
if (i % 2) {
|
|
obj.push([1, { foo: 1 }]);
|
|
} else {
|
|
obj.push({ foo: 1, bar: [1, 2] });
|
|
}
|
|
}
|
|
|
|
print(JSON.stringify(obj));
|
|
}
|
|
|
|
try {
|
|
noRecursionTest(10);
|
|
noRecursionTest(100);
|
|
noRecursionTest(1000);
|
|
} catch (e) {
|
|
print(e.name, e);
|
|
}
|
|
|
|
|