Skip to content

Commit 2279097

Browse files
committed
Make errors appear in the right place
1 parent 2089cff commit 2279097

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

html/webappapis/dynamic-markup-insertion/opening-the-input-stream/event-listeners.window.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,18 @@ test(t => {
5959
frame.contentDocument.close();
6060
}, "IDL attribute event handlers are to be deactivated");
6161

62+
var thrower;
63+
6264
test(t => {
6365
const frame = document.body.appendChild(document.createElement("iframe")),
6466
body = frame.contentDocument.body;
6567
t.add_cleanup(() => frame.remove());
6668
const div = body.appendChild(frame.contentDocument.createElement("div"));
67-
div.setAttribute("onclick", "throw new Error('element event listener not removed')");
69+
thrower = t.step_func(() => { throw new Error('element event listener not removed'); });
70+
div.setAttribute("onclick", "parent.thrower()");
6871
assert_not_equals(div.onclick, null);
6972
frame.contentDocument.open();
70-
assert_equals(div.getAttribute("onclick"), "throw new Error('element event listener not removed')");
73+
assert_equals(div.getAttribute("onclick"), "parent.thrower()");
7174
assert_equals(div.onclick, null);
7275
const e = frame.contentDocument.createEvent("mouseevents")
7376
e.initEvent("click", false, false);

0 commit comments

Comments
 (0)