| This page tests exceptions thrown from 'new' expressions. If the test passes, |
| you'll see a series of PASS messages below. |
| document.getElementById("console").appendChild(document.createTextNode(s + "\n")); |
| function shouldBe(a, aDescription, b) |
| log("PASS: " + aDescription + " should be '" + String(b) + "' and is."); |
| log ("FAIL: " + aDescription + " should be '" + String(b) + "' but instead is '" + String(a) + "'."); |
| shouldBe(e1, "e1", "TypeError: 'undefined' is not a constructor (evaluating 'new f')"); |
| shouldBe(e2, "e2", "TypeError: 'undefined' is not a function (evaluating 'g()')"); |