Skip to content

Commit

Permalink
More compact SES compatibility in example (merge #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal authored Jul 30, 2024
2 parents 786bd09 + c5f17e5 commit 2325959
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/content/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,15 @@ function on `globalThis`.
```js
const c = new Compartment({
globals: harden({ print }),
__options__: true,
});

c.evaluate(`print('Hello! Hello?');`);
```

> **Compatibility:** XS and SES have not yet converged on the same signature
> for the `Compartment` constructor.
> XS supports the above pattern and until a future version, SES compartments
> accept the globals as their first argument.
>
> ```js
> import 'ses';
>
> const c = new Compartment({
> print: harden(console.log),
> });
>
> c.evaluate(`print('Hello! Hello?');`);
> ```
> The `__options__` argument is a temporary accommodation for `ses`
> compatibility starting with version 1.6.0 and intended to become unnecessary
> in 2.0.0.
### Harden

Expand Down

0 comments on commit 2325959

Please sign in to comment.