proposal-compartments
proposal-compartments copied to clipboard
Compartmentalization of host behavior hooks for JS
Hi, I am wondering about what kind of user stories we are thinking about here, and how they differ from realms. This seems like a more light weight solution for...
The function constructor captures the active script or module when creating a function object, at step 15 of https://tc39.es/ecma262/#sec-ordinaryfunctioncreate. This means that, given this `a.js` module: ```js Function("import('./b.js')")(); ``` it...
(This partially follows [this comment](https://github.com/tc39/proposal-compartments/pull/71#discussion_r924029800) however it covers wider concerns and possible solutions). So the new proposal introduces `Module` which allows for customizing import behaviour with JS hooks. Additionally one...
The current spec does not support executing a module without knowing whether it is async or not (search `HasTLA` in the spec). We need to refactor the spec to support...
This PR introduces the host integration to prevent code from being evaluated when needed.
At the [September 21, 2022 SES Strategy call](https://youtu.be/7IwcEtkrQTo) we discussed three options for timing the construction of `import.meta` for a virtual module. 1. Prior (before Module construction): The ModuleSource instance...
With #77, we no longer thread `referrer` and do not have a need to thread the referrer. However, every practical implementation will need to use a `referrer` property on module...
```js const e = new Evaluator({ globalThis: {} }) e.eval("Math") // object? ReferenceError? e.eval("Module") // equal to e.Module? ReferenceError? e.eval("Evaluator") // ? ```
So right now the spec defines modules to hosts sort of like this: 1. Modules are concrete things with their own state and methods and whatnot 2. Modules cache successful...
The global contour is a scope that overshadows `globalThis` when evaluating “global code”. The global contour is the scope that persists variable declarations between calls to evaluate global code. Framed...