blob: 0a8d5551eefe0dda69d730a7b12284b53a3cf79b [file] [log] [blame]
description(
'Tests to make sure we do not gc the constants contained by functions defined inside eval code. To pass we need to not crash.'
);
function gc()
{
if (this.GCController)
GCController.collect();
else
for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objects to force a GC.
({});
}
evalStringTest = "'test'";
evalString = "function f() { shouldBe(\"'test'\", evalStringTest) }; f()";
function doTest() {
eval(evalString);
}
doTest();
gc();
// Scribble all over the registerfile and c stacks
a={};
a*=({}*{}+{}*{})*({}*{}+{}*{})+({}*{}+{}*{});
[[[1,2,3],[1,2,3],[1,2,3]],[[1,2,3],[1,2,3],[1,2,3]],[[1,2,3],[1,2,3],[1,2,3]]];
gc();
a={};
a*=({}*{}+{}*{})*({}*{}+{}*{})+({}*{}+{}*{});
[[[1,2,3],[1,2,3],[1,2,3]],[[1,2,3],[1,2,3],[1,2,3]],[[1,2,3],[1,2,3],[1,2,3]]];
gc();
a={};
a*=({}*{}+{}*{})*({}*{}+{}*{})+({}*{}+{}*{});
[[[1,2,3],[1,2,3],[1,2,3]],[[1,2,3],[1,2,3],[1,2,3]],[[1,2,3],[1,2,3],[1,2,3]]];
doTest();