| <html> |
| <head> |
| <script> |
| function test() { |
| alert( |
| 'This test verifies that exception thrown while converting an object to string ' |
| + 'are correctly propagated and do not crash the browser.'); |
| |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| } |
| |
| var throwing = { toString: function() { throw 'EXCEPTION'; } }; |
| try { |
| document.images.item(throwing); |
| alert('FAIL: document.images.item(throwing) should have thrown an exception!'); |
| } catch (e) { |
| alert('OK: ' + e); |
| } |
| try { |
| document.images[throwing]; |
| alert('FAIL: document.images[throwing] should have thrown an exception!'); |
| } catch (e) { |
| alert('OK: ' + e); |
| } |
| } |
| </script> |
| </head> |
| <body onload='test()'> |
| </body> |
| </html> |