| <script src="../../resources/js-test-pre.js"></script> |
| description('Tests that malformed code in event handler attributes does not cause a crash'); |
| function dispatchClick(element) |
| var clickEvent = document.createEvent('MouseEvent'); |
| clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); |
| element.dispatchEvent(clickEvent); |
| // Ignore errors due to the syntax error in the attribute. |
| window.onerror = function() { |
| var div = document.createElement('div'); |
| div.setAttribute('onclick', 'return 42; }(); var x = {'); |
| testPassed('Did not crash'); |
| <script src="../../resources/js-test-post.js"></script> |