Skip to content

src: introduce node::Realm

To distinguish per-context values from the node::Environment, split those values to a new node::Realm structure and consolidate bootstrapping methods with it.

This allows creating multiple realms in a node::Environment. There can be two kinds of realms:

  • A principal realm, comes with a host/implementation-defined global object,
  • A synthetic realm, is created by the ShadowRealm API and includes a reduced set of global object properties.

When the changes in this PR are landed with assent, works on migrating BaseObjects to be per-realm native objects and support built-in modules in synthetics realms like ShadowRealm can be started.

Refs: https://github.com/nodejs/node/issues/42528

Merge request reports

Loading