Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / cached-eval-gc.js
blob0a8d5551eefe0dda69d730a7b12284b53a3cf79b
1 description(
2 'Tests to make sure we do not gc the constants contained by functions defined inside eval code. To pass we need to not crash.'
3 );
5 function gc()
7 if (this.GCController)
8 GCController.collect();
9 else
10 for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objects to force a GC.
11 ({});
14 evalStringTest = "'test'";
15 evalString = "function f() { shouldBe(\"'test'\", evalStringTest) }; f()";
16 function doTest() {
17 eval(evalString);
19 doTest();
20 gc();
22 // Scribble all over the registerfile and c stacks
23 a={};
24 a*=({}*{}+{}*{})*({}*{}+{}*{})+({}*{}+{}*{});
25 [[[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]]];
26 gc();
27 a={};
28 a*=({}*{}+{}*{})*({}*{}+{}*{})+({}*{}+{}*{});
29 [[[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]]];
30 gc();
31 a={};
32 a*=({}*{}+{}*{})*({}*{}+{}*{})+({}*{}+{}*{});
33 [[[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]]];
35 doTest();