| This test verifies that property caching behaves correctly in the face of deleted |
| properties. If the test passes, you'll see a series of PASS messages below. |
| document.getElementById("console").appendChild(document.createTextNode(s + "\n")); |
| function shouldBe(a, aDescription, b) |
| log("PASS: " + aDescription + " should be " + b + " and is."); |
| log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + "."); |
| Array.equal = function equal(a, b) |
| if (a.length != b.length) |
| for (var i = 0; i < a.length; ++i) |
| var expectedProperties = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; |
| function getProperties(o) |
| function addProperties(o) |
| function removeProperties(o) |
| for (var i = 0; i < 3; ++i) { |
| properties = getProperties(o); |
| shouldBe(Array.equal(properties, expectedProperties), "Array.equal(properties, expectedProperties)", true); |
| o = { x: 0, y: 0, z: 0 }; |
| for (var i = 0; i < 3; ++i) { |