| <p>Tests that custom prototypes on DOM objects persist after garbage collection.</p> |
| return document.getElementById(id); |
| $("console").appendChild(document.createTextNode(s + "\n")); |
| function shouldBe(aDescription, a, b) |
| log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + "."); |
| log("PASS: " + aDescription + " should be " + b + " and is."); |
| if (window.GCController) { |
| for (var i = 0; i < 10000; ++i) |
| function shouldBeNull(aDescription, a) |
| log("PASS: " + aDescription + " should be null and is."); |
| log("FAIL: " + aDescription + " should be null but instead is " + a + "."); |
| function shouldBeNonNull(aDescription, a) |
| log("PASS: " + aDescription + " should be null and is."); |
| log("FAIL: " + aDescription + " should be null but instead is " + a + "."); |
| shouldBeNonNull("$('p').__proto__", $('p').__proto__); |
| shouldBeNull("$('p').__proto__", $('p').__proto__); |
| shouldBeNull("$('p').__proto__", $('p').__proto__); |