Re: [heycam/webidl] State that by default all objects are created in the relevant realm of `this` (#135)

So here is my take on this.

1)  For created-and-cached objects, we want to use the relevant realm.  Whether they're lazily-created or eagerly-created shouldn't matter here; in the latter case the relevant realm is the only one that can be used anyway.

2) For newly-created-and-returned objects, I think it's generally best to do the same thing, for consistency.

3) My previous concerns were basically around newly-created Promise return values.  Those are a bit special in the sense that they're really control flow reified as objects.  But I thought about this some more, and we'd generally want to create the promise _resolution_ value in the relevant global, and in that case it's probably best to create the Promise there too.

I realize this is not what the ES spec does, not least because ES has no concept of "relevant global".  ES doesn't even do this for the "create and cache" case, which is pretty weird.   Given that, I really don't think we should aim for aligning with ES here (as in, I consider its behavior to just be wrong in a bunch of cases).

-- 
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/135#issuecomment-416735871

Received on Tuesday, 28 August 2018 20:51:09 UTC