Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / pic / cached-array-length-access.html
blob7743e6a78998f178e508d4eceecc15c4796b16eb
1 <p>
2 This page tests cached access to properties of dictionary objects and objects
3 with changing prototypes. If the test passes, you'll see a series of PASS messages
4 below.
5 </p>
7 <pre id="console"></pre>
9 <script>
10 (function() {
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 function log(s)
16 if (this.document)
17 document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
18 else
19 print(s + "\n");
22 function shouldBe(a, aDescription, b)
24 if (a === b) {
25 log("PASS: " + aDescription + " should be " + b + " and is.\n");
26 } else {
27 log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".\n");
31 (function() {
32 var largestInteger = 4294967295;
33 var array = new Array();
34 array[largestInteger - 1] = "test";
35 var len = -1;
36 for (var i=0; i<10; ++i) len = array.length;
38 shouldBe(len, "len", largestInteger);
39 })();
41 })();
42 </script>