2 This page tests for a caching error when transitioning prototypes away from being dictionaries.
3 If the test passes, you'll see a series of PASS messages below.
6 <pre id=
"console"></pre>
10 testRunner
.dumpAsText();
15 document
.getElementById("console").appendChild(document
.createTextNode(s
+ "\n"));
20 function shouldBe(aDescription
, a
, b
)
23 log("PASS: " + aDescription
+ " should be " + b
+ " and is.");
25 log("FAIL: " + aDescription
+ " should be " + b
+ " but instead is " + a
+ ".");
44 o
.__proto__
.c
= "c"; // if o.__proto__ un-dictionaries itself, .c will overwrite the deleted .b slot.
45 for (var i
= 0; i
< 3; ++i
)
46 shouldBe("getB(o)", getB(o
), "b");
55 delete o2
.__proto__
.a2
;
56 o2
.__proto__
.c2
= "c2"; // if o2.__proto__ un-dictionaries itself, .c2 will overwrite the deleted .b slot.
57 for (var i
= 0; i
< 3; ++i
)
58 shouldBe("getB(o2)", getB(o2
), "b");
61 // Prototype chain tests
77 delete o
.__proto__
.__proto__
.a
;
78 o
.__proto__
.__proto__
.c
= "c"; // if o.__proto__.__proto__ un-dictionaries itself, .c will overwrite the deleted .b slot.
79 for (var i
= 0; i
< 3; ++i
)
80 shouldBe("getB(o)", getB(o
), "b");
91 delete o2
.__proto__
.__proto__
.a2
;
92 o2
.__proto__
.__proto__
.c
= "c"; // if o2.__proto__.__proto__ un-dictionaries itself, .c will overwrite the deleted .b slot.
93 for (var i
= 0; i
< 3; ++i
)
94 shouldBe("getB(o2)", getB(o2
), "b");