W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: Custom element design with ES6 classes and Element constructors

From: Dimitri Glazkov <dglazkov@google.com>
Date: Wed, 14 Jan 2015 08:52:55 -0800
Message-ID: <CADh5Ky3x0VGbEXqGEdVJSciDKqhNT9kOHe109deaLTM_nOQoMA@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: public-webapps <public-webapps@w3.org>
On Mon, Jan 12, 2015 at 9:11 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 1/12/15 12:20 PM, Tab Atkins Jr. wrote:
>
>> Proto munging isn't even that big of a deal.
>>
>
> That really depends.
>
> For example, dynamically changing __proto__ on something somewhat
> permanently deoptimizes that object in at least some JS engines. Whether
> that's a big deal depends on what you do with your objects.


This is true.

Would like to point out that we're not talking about a general case here.
The actual proto munging in custom elements spec is minimized to a pretty
small set.

Given that most engines use lazily created wrappers, the actual setting of
the prototype won't even need to happen unless the developer first accessed
the element, thus creating a wrapper.

Also, the current design doesn't change the prototype chain arbitrarily:
the effect is limited to inserting a sub-chain into the existing chain.
IOW:  A-E + B-C-D-E  --> A-B-C-D-E. Thus, the base type is always the same.

:DG<
Received on Wednesday, 14 January 2015 16:53:29 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC