[Webkit-unassigned] [Bug 145155] ES6 classes: Subclassing arrays doesn't work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 2 11:13:57 PST 2015


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

Richard Connamacher <richardconnamacher at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richardconnamacher at gmail.co
                   |                            |m

--- Comment #1 from Richard Connamacher <richardconnamacher at gmail.com> ---
WebKit isn't setting the right prototype chain when instantiating an Array subclass. Because of this, the following workaround restores the correct behavior in the WebKit nightly:

var MyArray = class MyArray extends Array {
    constructor() {
        super(...arguments);
        Object.setPrototypeOf(this, new.target.prototype);
    }

    myMethod() {}
};

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151202/24f87a88/attachment.html>


More information about the webkit-unassigned mailing list