diff options
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.window.js')
-rw-r--r-- | testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.window.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.window.js b/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.window.js new file mode 100644 index 0000000000..2892a4c3ab --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.window.js @@ -0,0 +1,16 @@ +setup({ allow_uncaught_exception: true }); + +test(function() { + var events = []; + window.onerror = function() { + events.push("error"); + }; + + var div = document.createElement("div"); + div.addEventListener("click", function (e) { events.push("click 1") }); + div.setAttribute("onclick", "}"); + div.addEventListener("click", function (e) { events.push("click 2") }); + div.dispatchEvent(new Event("click")); + assert_equals(div.onclick, null); + assert_array_equals(events, ["click 1", "error", "click 2"]); +}, "Invalid uncompiled raw handlers should only be compiled when about to call them"); |