2 This test verifies that property caching behaves correctly in the face of deleted
3 properties. If the test passes, you'll see a series of PASS messages below.
6 <pre id=
"console"></pre>
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
16 document
.getElementById("console").appendChild(document
.createTextNode(s
+ "\n"));
21 function shouldBe(a
, aDescription
, b
)
24 log("PASS: " + aDescription
+ " should be " + b
+ " and is.");
26 log("FAIL: " + aDescription
+ " should be " + b
+ " but instead is " + a
+ ".");
30 Array
.equal
= function equal(a
, b
)
32 if (a
.length
!= b
.length
)
34 for (var i
= 0; i
< a
.length
; ++i
)
40 var expectedProperties
= [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
42 function getProperties(o
)
58 function addProperties(o
)
72 function removeProperties(o
)
97 for (var i
= 0; i
< 3; ++i
) {
99 properties
= getProperties(o
);
100 shouldBe(Array
.equal(properties
, expectedProperties
), "Array.equal(properties, expectedProperties)", true);
103 o
= { x
: 0, y
: 0, z
: 0 };
105 for (var i
= 0; i
< 3; ++i
) {
107 shouldBe(o
.x
, "o.x", 1);