| <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.testRunner) |
| testRunner.dumpAsText(); |
| |
| var result = /define/.test(); |
| shouldBe(result, "result", true); |
| </script> |