Home

Awesome

ECMAScript spec proposal for ShadowRealm API

<a name='Status'></a>Status

<a name='Champions'></a>Champions

Index

<a name='WhatareRealms'></a>What are ShadowRealms?

ShadowRealms are a distinct global environment, with its own global object containing its own intrinsics and built-ins (standard objects that are not bound to global variables, like the initial value of Object.prototype).

See more at the explainer document.

<a name='APITypeScriptFormat'></a>API (TypeScript Format)

declare class ShadowRealm {
    constructor();
    importValue(specifier: string, bindingName: string): Promise<PrimitiveValueOrCallable>;
    evaluate(sourceText: string): PrimitiveValueOrCallable;
}

See some examples in the Explainer file.

<a name='Presentations'></a>Presentations

<a name='History'></a>History

<a name='Contributing'></a>Contributing

<a name='Updatingthespectextforthisproposal'></a>Updating the spec text for this proposal

The source for the spec text is located in spec.html and it is written in ecmarkup language.

When modifying the spec text, you should be able to build the HTML version by using the following command:

npm install
npm run build
open dist/index.html

Alternatively, you can use npm run watch.