Overview: class FooEvent extends CustomEvent { constructor() { super('foo'); } }; var foo = new FooEvent(); console.log('This evaluates to "false" which is unexpected', foo instanceof FooEvent); console.log('This evaluates to "true" which is expected', foo instanceof CustomEvent); console.log('This evaluates to "true" which is expected', foo instanceof Event); Expected Results: The instanceof operator, when given an instance of FooEvent which extends CustomEvent, and the FooEvent constructor, should evaluate to "true". Build Date & Hardware: Release 61 (Safari 12.0, WebKit 13606.1.25.1) Mac OS 10.13.6
I don't think class inheritance ever worked with Event's.
It seems to be working as expected in Firefox and Chrome, and Edge has the following open issue: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11923584/
(In reply to Eugene Kashida from comment #0) > Expected Results: > > The instanceof operator, when given an instance of FooEvent which extends > CustomEvent, and the FooEvent constructor, should evaluate to "true". As of https://trac.webkit.org/changeset/256716, extending CustomEvent (as well as other DOM constructors) works as expected.
<rdar://problem/60743143>