Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / regex / syntax-errors.html
blobe18d128d46dfc85eb23ebad6608caa32b04c66b8
1 <p>This test verifies that implicit creation of a regular expression eagerly checks for syntax errors.</p>
2 <p>If the test passes, you'll see pass messages below.</p>
3 <pre id="console"></pre>
5 <script>
6 function log(s)
8 document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
11 function shouldThrow(program)
13 try {
14 eval(program);
15 log("FAIL: " + program + " should throw an exception but didn't");
16 } catch (e) {
17 log("PASS: " + program + " should throw an exception and did: " + e + ".");
21 if (window.testRunner)
22 testRunner.dumpAsText();
24 shouldThrow('"abc".search("[")');
25 shouldThrow('"abc".match("[")');
26 </script>