1 <p>This page tests var declarations inside various block structures and control statements.
</pre>
2 <pre id=
"console"></pre>
6 testRunner
.dumpAsText();
10 document
.getElementById("console").appendChild(document
.createTextNode(s
+ "\n"));
13 function shouldBe(a
, b
)
23 log("PASS: " + a
+ " should be " + b
+ " and is.");
25 log("FAIL: " + a
+ " should be " + b
+ " but instead is " + evalA
+ ".");
29 function testDeclarations(title
)
45 for (var i
= 0; i
< vars
.length
; ++i
)
46 shouldBe("'" + vars
[i
] + "' in window", true);
49 testDeclarations("Before executing blocks containing var declarations: ");
70 for (var i
= 0; i
< 0; ++i
) {
91 testDeclarations("After executing blocks containing var declarations: ");