1 <p>This page tests function 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
< functions
.length
; ++i
)
46 shouldBe("'" + functions
[i
] + "' in window", true);
49 testDeclarations("Before executing blocks containing function declarations: ");
70 for (var i
= 0; i
< 0; ++i
) {
91 testDeclarations("After executing blocks containing function declarations: ");