Re: Defining a constructor for Element and friends

> On Jan 13, 2015, at 8:26 PM, Domenic Denicola <d@domenic.me> wrote:
> 
> From: Bjoern Hoehrmann [mailto:derhoermi@gmx.net] 
> 
>> I know that this a major concern to you, but my impression is that few if any other people regard that as anything more than "nice to have", especially if you equate "explaining" with having a public API for it.
> 
> How do you propose having a private constructor API?

I don't think we need to make the constructor of HTMLUnknownElement private.  It certainly isn't today.  We just need to throw whenever it's called.

> How do you propose instances of the objects even existing at all, if there is no constructor that creates them?
> 
> This is one of those "only makes sense to a C++ programmer" things.

We can model it as a constructor that takes a private symbol only the DOM implementation has access to, and throws whenever this symbol is not passed in as an argument.

- R. Niwa

Received on Wednesday, 14 January 2015 07:47:04 UTC