1 <p>Tests for compilation errors in trivial functions.
</p>
2 <pre id=
"console"></pre>
9 return document
.getElementById(id
);
14 $("console").appendChild(document
.createTextNode(s
+ "\n"));
17 function shouldBe(aDescription
, a
, b
)
20 log("PASS: " + aDescription
+ " should be " + b
+ " and is.");
24 log("FAIL: " + aDescription
+ " should be " + b
+ " but instead is " + a
+ ".");
27 function f1(a
, b
) { return a
[b
]; }
28 function f2(a
, b
, c
) { return a
[b
] = c
; }
30 if (window
.testRunner
)
31 testRunner
.dumpAsText();
33 shouldBe("f1(0, 0)", f1(0, 0), undefined);
34 shouldBe("f2(0, 0, 0)", f2(0, 0, 0), 0);