Re: [w3c/webcomponents] Move the check for HTMLElement and its subclass from customElements.define to construction timing (#541)

> > Also, I'm not sure how your check works against Proxy objects.
>
> I think the `new.target` would still be the original constructor (when the proxy delegates construction). So it would still fail. But I guess we don't need to worry about it any more.

My point was that this case is hard/impossible to catch at definition time. e.g. `constructor = new Proxy(HTMLElement, {});`  Then `constructor !== HTMLElement` yet it would still construct `HTMLElement`.   So the only timing at which we can catch case like this is at construction time when as you said it `new.target` would tell us exactly which object we're trying to construct.

-- 
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/541#issuecomment-239890346

Received on Monday, 15 August 2016 18:44:38 UTC