Re: document.register and ES6

On 2/5/13 10:12 PM, Erik Arvidsson wrote:
> In ES6 speak, we have split the "new Foo(...args)" expression into
> "[@@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() {

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