The ShadowRealm proposal from TC39 introduces a JavaScript API for code isolation and execution.
- •JavaScript realms are single-threaded, with each realm maintaining its own global object and intrinsic objects
- •ShadowRealms create isolated execution environments without their own thread, running code on the parent's main thread
- •Code is quarantined from the outer realm's global object and APIs, preventing global scope pollution
- •The API uses simple syntax: new ShadowRealm() and shadow.evaluate() to execute code in isolation
- •ShadowRealms have pristine global and built-in objects, preventing interference between realms
This summary was automatically generated by AI based on the original article and may not be fully accurate.