Re: Determining what prototype should be used for an object

On Mon, Nov 17, 2014 at 3:41 PM, Boris Zbarsky <> wrote:
> So let's try this specific example of Node and .childNodes.  It seems to me
> that the process of creation here should go something like this:
> 1)  Go to create a Node.
> 2)  Discover that it wants to be in a particular Realm, make that Realm
>     current.
> 3)  Create the Node.  This triggers creation of the .childNodes
>     NodeList somehow.  It's very important that this creation happen
>     here, while our desired Realm is current.
> 4)  Restore the old current Realm.
> Does that seem sane?

Yes. It seems like Realm might be the only real variable for creation.
Do we know of cases where we want a different Realm?

I think finding an object's associated objects that need to be created
should be done through IDL syntax. I think describing the internal
slots would make a lot of sense for that, though if we just want to
solve the associated object problem we could come up with something
simpler. (I have a hunch that having internal slots more formally
defined will help us in other ways too down the line, but nothing
really concrete so far.)

So IDL's part of creation would be creating the desired object in the
given/implied Realm and creating that object's associated objects in
the same Realm.


Received on Monday, 17 November 2014 15:04:18 UTC