[Webkit-unassigned] [Bug 188083] New: The instanceof operator does not work as expected for classes that extend CustomEvent or Event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 26 15:47:17 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=188083

            Bug ID: 188083
           Summary: The instanceof operator does not work as expected for
                    classes that extend CustomEvent or Event
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ekashida at gmail.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180726/2884ba27/attachment-0001.html>


More information about the webkit-unassigned mailing list