Bug 183629

Summary: Allow extending of event objects
Product: WebKit Reporter: Jake Archibald <jaffathecake>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ashvayka
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=174313

Jake Archibald
Reported 2018-03-14 05:56:38 PDT
class Foo extends Event {} console.log(new Foo('bar').constructor); Chrome & Firefox say Foo, Edge & Safari say Event. The Chrome/Firefox behaviour is preferable, as it allows you to create custom event objects, which is especially useful when developing custom elements.
Attachments
Lucas Forschler
Comment 2 2019-02-06 09:19:17 PST
Mass move bugs into the DOM component.
Alexey Shvayka
Comment 3 2020-04-17 15:03:38 PDT
(In reply to Jake Archibald from comment #1) > Tests: http://w3c-test.org/dom/events/Event-subclasses-constructors.html As of r256716, extending Event (as well as other DOM constructors) works as expected. Provided test file is 100% passing.
Note You need to log in before you can comment on or make changes to this bug.