Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / htmlcollection-conversion-throws-exception.html
blobdeffb06ab513c9668677bd2d8ef2f111e8cb9c7e
1 <html>
2 <head>
3 <script>
4 function test() {
5 alert(
6 'This test verifies that exception thrown while converting an object to string '
7 + 'are correctly propagated and do not crash the browser.');
9 if (window.testRunner) {
10 testRunner.dumpAsText();
13 var throwing = { toString: function() { throw 'EXCEPTION'; } };
14 try {
15 document.images.item(throwing);
16 alert('FAIL: document.images.item(throwing) should have thrown an exception!');
17 } catch (e) {
18 alert('OK: ' + e);
20 try {
21 document.images[throwing];
22 alert('FAIL: document.images[throwing] should have thrown an exception!');
23 } catch (e) {
24 alert('OK: ' + e);
27 </script>
28 </head>
29 <body onload='test()'>
30 </body>
31 </html>