2 This page tests exceptions thrown from 'new' expressions. If the test passes,
3 you'll see a series of PASS messages below.
5 <pre id=
"console"></pre>
10 document
.getElementById("console").appendChild(document
.createTextNode(s
+ "\n"));
13 function shouldBe(a
, aDescription
, b
)
16 log("PASS: " + aDescription
+ " should be '" + String(b
) + "' and is.");
20 log ("FAIL: " + aDescription
+ " should be '" + String(b
) + "' but instead is '" + String(a
) + "'.");
23 if (window
.testRunner
)
24 testRunner
.dumpAsText();
31 shouldBe(e1
, "e1", "TypeError: 'undefined' is not a constructor (evaluating 'new f')");
41 shouldBe(e2
, "e2", "TypeError: 'undefined' is not a function (evaluating 'g()')");