tc39 / proposal-shadowrealm

ECMAScript Proposal, specs, and reference implementation for Realms
https://tc39.es/proposal-shadowrealm/
1.44k stars 67 forks source link

A bit more ergonomics under the current isolation realms? #300

Closed Jack-Works closed 3 years ago

Jack-Works commented 3 years ago

The currently isolated realms only have primitives and wrapped callables to be passed. Although it is already enough for cross-realms communication, it will be quite a pain API to use.

I'm curious if it is possible to add more kinds of items to be wrapped, for example:

leobalter commented 3 years ago

This is not what we are pursuing here and goes beyond the goals for ergonomics of a low level API.

We decided this while removing AsyncFunction in #289 and from several iterations over this new proposal. I believe I also made it clear in the TC39 plenary this week that is intentional we are not giving special handlers for non-callable objects.

It would be too much to be wrapped in engine level while this communication is already possible through a membrane framework implementation in user land.