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;
8 return new Array(1000);
11 Array
.prototype.thingy
= 24;
13 function done(value
) {
14 var expected
= (24 + 1000) * 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
+= " var theArray = bar();\n";
36 code
+= " result += theArray.thingy + theArray.length;\n";
38 code
+= "window.parent.done(result);\n";
39 code
+= "</script></body></html>";
41 testFrame
.contentDocument
.write(code
);
42 testFrame
.contentDocument
.close();
45 window
.setTimeout(doit
, 10);