| 14:56 | <nicolo-ribaudo> | I have a question that came up when thinking about module blocks, and maybe you already thought about it for the Module class. When importing in realm B a Module created in realm A, do you think that it should be evaluated in realm A or in realm B?With cloning (or re-wrapping its ModuleSource in a new Module) it's obviously in realm B, but with same-domain iframes you can pass an object to another realm without cloning it. |
| 15:19 | <Kris Kowal> | The module constructor should have a [[Context]] execution context internal slot that binds it to a realm. |
| 15:20 | <Kris Kowal> | That would be how we recover the isolation feature for compartments, which are also many-per-realm. |
| 15:20 | <Kris Kowal> | I believe this is analogous to Function constructor. |
| 15:20 | <nicolo-ribaudo> | Ok yes, thanks 👍 It's exactly how functions work. |
| 15:21 | <Kris Kowal> | Our hope is to carve out a proposal for ExecutionContext(globalThis, importHook) that would yield a new set of evaluators, eval, Function, and Module. |
| 15:21 | <Kris Kowal> | Since that’s the last bit that makes it possible to implement compartments. |