blob: d636c9e85eefa08c7e305d600a6310939f41dbe8 [file] [log] [blame]
Verify that we do not recurse infinitely through one of the Array->string conversion.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS var arrayDirectlyContainingItself = [];
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.toString(); is ""
PASS var arrayDirectlyContainingItself = [];
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.toLocaleString(); is ""
PASS var arrayDirectlyContainingItself = [];
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.join(","); is ""
PASS var arrayDirectlyContainingItself = [];
arrayDirectlyContainingItself.push(1);
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.push("WebKit!");
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.toString(); is "1,,WebKit!,"
PASS var arrayDirectlyContainingItself = [];
arrayDirectlyContainingItself.push(1);
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.push("WebKit!");
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.toLocaleString(); is "1,,WebKit!,"
PASS var arrayDirectlyContainingItself = [];
arrayDirectlyContainingItself.push(1);
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.push("WebKit!");
arrayDirectlyContainingItself.push(arrayDirectlyContainingItself);
arrayDirectlyContainingItself.join("-"); is "1--WebKit!-"
PASS var arrayIndirectlyContainingItself = [];
arrayIndirectlyContainingItself.push(1);
arrayIndirectlyContainingItself.push([1, 2, [5, 6, [arrayIndirectlyContainingItself]]]);
arrayIndirectlyContainingItself.push("WebKit!");
arrayIndirectlyContainingItself.toString(); is "1,1,2,5,6,,WebKit!"
PASS var arrayIndirectlyContainingItself = [];
arrayIndirectlyContainingItself.push(1);
arrayIndirectlyContainingItself.push([1, 2, [5, 6, [arrayIndirectlyContainingItself]]]);
arrayIndirectlyContainingItself.push("WebKit!");
arrayIndirectlyContainingItself.toLocaleString(); is "1,1,2,5,6,,WebKit!"
PASS var arrayIndirectlyContainingItself = [];
arrayIndirectlyContainingItself.push(1);
arrayIndirectlyContainingItself.push([1, 2, [5, 6, [arrayIndirectlyContainingItself]]]);
arrayIndirectlyContainingItself.push("WebKit!");
arrayIndirectlyContainingItself.join("="); is "1=1,2,5,6,=WebKit!"
PASS var arrayIndirectlyContainingItself = [];
arrayIndirectlyContainingItself.push(1);
arrayIndirectlyContainingItself.push([1, 2, [5, 6, [arrayIndirectlyContainingItself]]]);
arrayIndirectlyContainingItself.push("WebKit!");
["z", arrayIndirectlyContainingItself, 9].toString(); is "z,1,1,2,5,6,,WebKit!,9"
PASS var arrayIndirectlyContainingItself = [];
arrayIndirectlyContainingItself.push(1);
arrayIndirectlyContainingItself.push([1, 2, [5, 6, [arrayIndirectlyContainingItself]]]);
arrayIndirectlyContainingItself.push("WebKit!");
["z", arrayIndirectlyContainingItself, 9].toLocaleString(); is "z,1,1,2,5,6,,WebKit!,9"
PASS var arrayIndirectlyContainingItself = [];
arrayIndirectlyContainingItself.push(1);
arrayIndirectlyContainingItself.push([1, 2, [5, 6, [arrayIndirectlyContainingItself]]]);
arrayIndirectlyContainingItself.push("WebKit!");
["z", arrayIndirectlyContainingItself, 9].join("&"); is "z&1,1,2,5,6,,WebKit!&9"
PASS var arrayIndirectlyConvertingItself = ["a"];
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.toString() } });
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.toLocaleString() } });
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.join("~") } });
arrayIndirectlyConvertingItself.push("WebKit!");
["z", arrayIndirectlyConvertingItself, 9].toString(); is "z,a,,,,WebKit!,9"
PASS var arrayIndirectlyConvertingItself = ["a"];
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.toString() } });
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.toLocaleString() } });
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.join("~") } });
arrayIndirectlyConvertingItself.push("WebKit!");
["z", arrayIndirectlyConvertingItself, 9].toLocaleString(); is "z,a,,,,WebKit!,9"
PASS var arrayIndirectlyConvertingItself = ["a"];
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.toString() } });
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.toLocaleString() } });
arrayIndirectlyConvertingItself.push({ array: arrayIndirectlyConvertingItself, toString: function() { return this.array.join("~") } });
arrayIndirectlyConvertingItself.push("WebKit!");
["z", arrayIndirectlyConvertingItself, 9].join("*"); is "z*a,,,,WebKit!*9"
PASS successfullyParsed is true
TEST COMPLETE