| <p>This page tests for a crash when throwing an exception from a callback provided |
| to String.prototype.replace. |
| <p>If the test passes, you'll see a series of PASS messages below. |
| document.getElementById("console").appendChild(document.createTextNode(s + "\n")); |
| // these should not crash |
| "aa".replace(/a/g, function() { |
| log ("PASS: You didn't crash."); |
| "aa".replace("a", function() { |
| log ("PASS: You didn't crash."); |
| // this should not continue execution after an exception |
| var message = "PASS: String.prototype.replace did not continue executing after an exception was thrown."; |
| "aa".replace(/a/g, function() { |
| message = "FAIL: String.prototype.replace continued executing after an exception was thrown."; |
| (function x() { return 'blargh'.replace(/a/g, x) })() |