<html>
<body onload="loaded()">
<p>This test checks that an exception thrown when getting the
handleEvent property of an event listener does not crash.</p>
<hr>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

function loaded() {
    var o = {};
    o.__defineGetter__("handleEvent", function() { throw 42; });
    var div = document.getElementById("div");
    div.onkeydown = o;
    var event = document.createEvent("KeyboardEvent");
    event.initKeyboardEvent("keydown", true, true, null, "Enter", "");
    div.dispatchEvent(event);
}
</script>
<div id="div">PASS: You didn't crash.</div>
</body>
</html>
