blob: 90f5877f96e22698464d6fc4d9e2186c142ff01e [file] [log] [blame]
<p>
This page tests the exception you get when you test a regular expression against
the null string. If the test passes, you'll see a PASS message below.
</p>
<pre id="console"></pre>
<script>
function log(s)
{
document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
}
function shouldBe(a, aDescription, b)
{
if (a == b) {
log("PASS: " + aDescription + " should be '" + String(b) + "' and is.");
return;
}
log ("FAIL: " + aDescription + " should be '" + String(b) + "' but instead is '" + String(a) + "'.");
}
if (window.layoutTestController)
layoutTestController.dumpAsText();
try {
/a/.test();
} catch (e) {
shouldBe(e, "e", "Error: No input to /a/.");
}
</script>