shadowrealm-api icon indicating copy to clipboard operation
shadowrealm-api copied to clipboard

🗳️ A implementation of the ShadowRealm API Proposal, a JavaScript sandbox, test with TC39 Test262 cases.

Results 5 shadowrealm-api issues
Sort by recently updated
recently updated
newest added

Testing this (seemingly awesome) polyfill (aside: how secure is it?) - thanks! But it seems to me I cannot return/export anything except primitives (or a function that returns primitives): ```javascript...

`globalThis.crypto` is not available inside a realm. ```js import ShadowRealm from 'shadowrealm-api' const realm = new ShadowRealm() realm.evaluate(`console.log(globalThis.crypto)`) // undefined ```

## Description Transferable objects like `ArrayBuffer` cannot be passed. ``` TypeError: Cross-Realm Error: TypeError: need primitive or callable, got [object ArrayBuffer] at Object.wrapError (helpers.ts:78:16) at foobar (eval at createWrappedFunction (helpers.ts:116:44),...

I tried to implement it in web workers... Probably, all was in vain. Why? Because of you preferred to use iframe and window as globals. I tried to reassign, but...

I ran into the error `ERR_IMPORT_ASSERTION_TYPE_MISSING` when running `npm run build` (node version v18.17.1). Adding `assert { type: "json" }` seems to fix it. Ref: https://stackoverflow.com/questions/70106880/err-import-assertion-type-missing-for-import-of-json-file