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

Re: document.register and ES6

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 05 Feb 2013 22:28:21 +0000
Message-ID: <51118785.9090502@mit.edu>
To: Erik Arvidsson <arv@chromium.org>
CC: public-webapps <public-webapps@w3.org>, Dimitri Glazkov <dglazkov@google.com>, daniel@mozilla.com
On 2/5/13 10:12 PM, Erik Arvidsson wrote:
> In ES6 speak, we have split the "new Foo(...args)" expression into
> "Foo.call(Foo[@@create](), ...args)" which means that creating the
> instance has been separated from the call to the function.

So in particular this allows creation of "uninitialized" instances in 
some sense, yes?

> function MyButton() {
>    HTMLButtonElement.call(this);

This won't work right given how HTMLButtonElement is currently defined 
in WebIDL.  Need to fix that at the very least.

> MyButton.prototype = Object.create(HTMLButtonElement.prototype, {
>    ...
> });
> document.register(‘x-button’, MyButton);

And the point is that document.register changes the [[Construct]] of 
MyButton but does nothing else with it?

What happens if the same function is registered for several different 
tag names, in terms of what happens with the [[Construct]]?

> * Just before entering script,

Define, please.  How does one determine this, in a rendering engine 
implementation?  I certainly have no way to tell, in Gecko, when I'm 
"entering script", offhand....

Received on Tuesday, 5 February 2013 22:28:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:58 UTC