Re: [heycam/webidl] Proposal: allow subclasses of constructible built-ins to be constructed (#125)

> The object is branded as a DocumentFragment but not a ShadowRoot (because the branding is done at allocation time and the allocation happens in the DocumentFragment constructor).

But how does this work for subclasses that *are* constructible? E.g. if I do `new CustomEvent`, allocation happens in `Event`. How did it get the `CustomEvent` brand?

It seems to me like `new ShadowRoot()` should result in an object branded as both a DocumentFragment and a ShadowRoot, the same as `CustomEvent`. Maybe that means my proposal is not just a pass-through constructor, but a pass through that also adds a brand? (It's not really defined where the branding happens right now...)

> I think the right answer here is probably to do something specific to elements, because they have this weird setup where the base class constructor creates subclasses based on some sort of out of band information. For things that don't do that, passthrough is not the right behavior.

I am in general convinced, but am curious about your thoughts on the above question first.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/125#issuecomment-220728855

Received on Friday, 20 May 2016 22:01:46 UTC