Re: [webcomponents] ES5 consideration for custom elements (#423)

Thank you for the quick reply!

To take it a step further, the pattern of using Reflect.construct would be required for all ES5 style derived "classes" that want to extend base constructors that create exotic objects. This is probably not unique to HTMLElement, but also to Array, etc. Does that seem fair?

If that is the case, the spec makes the following note:
````
For now, the HTMLElement constructor cannot be invoked directly. It only works when used via a super() call inside a custom element constructor.
````

Is this note implying that:

- Reflect.construct will not be required in the future as a non-exotic object will be returned from the HTMLElement constructor or 
- Is this implying that browsers do not currently have Reflect.construct, but in the future browsers could invoke the base constructor through either a call to super() or using Reflect.construct?

Side note: I found the [Exploring JS: Classes] (http://exploringjs.com/es6/ch_classes.html) chapter very helpful for this discussion


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/423#issuecomment-200077346

Received on Tuesday, 22 March 2016 23:26:46 UTC