2 "This tests that function inlining in the DFG JIT doesn't get confused about the global object to use for array allocation."
5 window
.jsTestIsAsync
= true;
11 Array
.prototype.thingy
= 24;
13 function done(value
) {
14 var expected
= 24 * 200;
15 if (value
== expected
)
16 testPassed("done() called with " + expected
);
18 testFailed("done() called with " + value
+ ", but expected " + expected
);
23 document
.getElementById("frameparent").innerHTML
= "";
24 document
.getElementById("frameparent").innerHTML
= "<iframe id='testframe'>";
25 var testFrame
= document
.getElementById("testframe");
26 testFrame
.contentDocument
.open();
28 code
= "<!DOCTYPE html>\n<head></head><body><script type=\"text/javascript\">\n";
29 code
+= "Array.prototype.thingy = 42;\n";
30 code
+= "function bar() {\n";
31 code
+= " return window.parent.foo();\n";
33 code
+= "var result = 0;\n";
34 code
+= "for (var i = 0; i < 200; ++i)\n";
35 code
+= " result += bar().thingy;\n";
36 code
+= "window.parent.done(result);\n";
37 code
+= "</script></body></html>";
39 testFrame
.contentDocument
.write(code
);
40 testFrame
.contentDocument
.close();
43 window
.setTimeout(doit
, 10);