Skip to content

Commit 1927a16

Browse files
committed
feat: test for event target
1 parent 35da652 commit 1927a16

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/tests/dom/event_target.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,13 @@
113113
// doesn't crash on null receiver
114114
content.addEventListener('he2', null);
115115
content.dispatchEvent(new Event('he2'));
116+
117+
// Test that EventTarget constructor properly initializes vtable
118+
const et = new EventTarget();
119+
testing.expectEqual('[object EventTarget]', et.toString());
120+
121+
let constructorTestCalled = false;
122+
et.addEventListener('test', () => { constructorTestCalled = true; });
123+
et.dispatchEvent(new Event('test'));
124+
testing.expectEqual(true, constructorTestCalled);
116125
</script>

0 commit comments

Comments
 (0)