2 "Tests that having a bad time has correct cross frame behavior, if an instance object is created in a different global object than the affected prototype, and the prototype is assigned using __proto__."
6 testRunner
.waitUntilDone();
12 function foo(thePrototype
) {
14 array
.__proto__
= thePrototype
;
16 for (var i
= 0; i
< 10; i
+=2)
20 function evil(thePrototype
) {
21 for (var i
= 0; i
< 10; i
+=2)
22 thePrototype
.__defineSetter__(i
+ 1, function() { ouches
++; });
26 for (var i
= 0; i
< 10; i
+=2)
31 var string
= Array
.prototype.join
.apply(array
, [","]);
32 debug("Array is: " + string
);
33 if (string
== "42,,42,,42,,42,,42,")
34 testPassed("Array has holes in odd numbered entries.");
36 testFailed("Array does not have the required holes.");
39 testPassed("Got 5 ouches.");
41 testFailed("Did not get 5 ouches. Got " + ouches
+ " + instead.");
44 testRunner
.notifyDone();
47 var frame
= document
.getElementById("myframe");
49 frame
.contentDocument
.open();
50 frame
.contentDocument
.write(
51 "<!DOCTYPE html>\n<html><body><script type=\"text/javascript\">\n" +
52 "var thePrototype = {};\n" +
53 "window.parent.foo(thePrototype);\n" +
54 "window.parent.evil(thePrototype);\n" +
55 "window.parent.bar();\n" +
56 "window.parent.done();\n" +
57 "</script></body></html>");
58 frame
.contentDocument
.close();