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

It'd be fine with me if we wrote somewhere that objects cannot be created from parallel contexts, and I agree with @annevk's goal to replace "in parallel" with better-specified threads.

I tentatively propose the following resolution to this issue:

1. WebIDL defines an ambient "object-creation realm" in WebIDL that's available (or null) for each step of an algorithm, and which propagates to the next and contained steps by default.
2. WebIDL defines "new" or "create" or "new object" to use that realm. The "new" phrasings are likely to work better in "let x be" phrases in prose.
3. WebIDL initializes the object-creation realm as @domenic said in the original post.
4. HTML defines "in parallel" to set the object-creation realm for the parallel steps. We could set it to the caller's realm in order to make most existing specs DTRT or to null if we want to start enforcing that objects aren't created from limbo.
5. HTML defines "queue a task" to take an explicit realm in addition to the task queue, and uses that for the task's object-creation realm. We should mention that specs often forget to pass this, and that their intent tends to be to propagate the caller's realm, but that can be deprecated.

-- 
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-286789309

Received on Wednesday, 15 March 2017 16:01:47 UTC