ses 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/NEWS.md +20 -0
- package/README.md +3 -6
- package/dist/lockdown.cjs +716 -590
- package/dist/lockdown.mjs +716 -590
- package/dist/lockdown.umd.js +716 -590
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses.cjs +716 -590
- package/dist/ses.mjs +716 -590
- package/dist/ses.umd.js +716 -590
- package/dist/ses.umd.min.js +1 -1
- package/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/commons.js +1 -0
- package/src/compartment-evaluate.js +6 -13
- package/src/compartment-shim.js +3 -41
- package/src/environment-options.js +4 -7
- package/src/error/assert.js +4 -0
- package/src/error/types.js +59 -0
- package/src/eval-scope.js +87 -0
- package/src/global-object.js +40 -1
- package/src/lockdown-shim.js +13 -18
- package/src/make-evaluate.js +110 -0
- package/src/make-function-constructor.js +6 -8
- package/src/make-safe-evaluator.js +32 -40
- package/src/module-instance.js +6 -6
- package/src/module-link.js +22 -36
- package/src/module-load.js +4 -7
- package/src/scope-constants.js +17 -13
- package/src/sloppy-globals-scope-terminator.js +53 -0
- package/src/strict-scope-terminator.js +88 -0
- package/src/tame-locale-methods.js +6 -10
- package/src/whitelist.js +0 -1
- package/src/make-evaluate-factory.js +0 -71
- package/src/scope-handler.js +0 -211
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.18.0](https://github.com/endojs/endo/compare/ses@0.17.0...ses@0.18.0) (2022-11-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* **ses:** Remove support for globalLexicals
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **ses:** Remove support for globalLexicals ([3b90d5d](https://github.com/endojs/endo/commit/3b90d5d96984ff211efe5e47de1ce57cde7be980)), closes [#904](https://github.com/endojs/endo/issues/904)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* assert touchups ([#1350](https://github.com/endojs/endo/issues/1350)) ([3fcb5b1](https://github.com/endojs/endo/commit/3fcb5b117eccb326c6c81339ae6a293a6bcaa9d4))
|
|
21
|
+
* fail template ([#1334](https://github.com/endojs/endo/issues/1334)) ([725b987](https://github.com/endojs/endo/commit/725b987ffa812a070ff45fcd496cf8fd88df6963))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.17.0](https://github.com/endojs/endo/compare/ses@0.16.0...ses@0.17.0) (2022-10-24)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### ⚠ BREAKING CHANGES
|
|
29
|
+
|
|
30
|
+
* **ses:** Prevent surprising global unscopables behavior
|
|
31
|
+
* **ses:** Divide scope proxy into four layers
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **ses:** Revocable evalScope ([0187d1e](https://github.com/endojs/endo/commit/0187d1e3532cfc2f052619c46a8a6331a8c15ae8))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* **ses:** Prevent surprising global unscopables behavior ([dcb8f5d](https://github.com/endojs/endo/commit/dcb8f5da2a453ac72b7f2cc3208f591a9c298402))
|
|
41
|
+
* **ses:** Protect necessary eval admission before it has been admitted ([3d022b1](https://github.com/endojs/endo/commit/3d022b1e1b34ff9b86cf6af236c499bfbe291298))
|
|
42
|
+
* **ses:** Typo in compartmentEvaluate ([d66db7a](https://github.com/endojs/endo/commit/d66db7a67fab6bdd36d18a931c6a9163e842c3fe))
|
|
43
|
+
* **ses:** Typo in scope-constants ([a4ee1ea](https://github.com/endojs/endo/commit/a4ee1ea5e54d894ad3a3ce0c5e42507f026199e6))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Code Refactoring
|
|
47
|
+
|
|
48
|
+
* **ses:** Divide scope proxy into four layers ([37c4b4a](https://github.com/endojs/endo/commit/37c4b4a22996e33dd4b2a48c67ce649ba88e5528))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [0.16.0](https://github.com/endojs/endo/compare/ses@0.15.23...ses@0.16.0) (2022-10-19)
|
|
7
53
|
|
|
8
54
|
|
package/NEWS.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
User-visible changes in SES:
|
|
2
2
|
|
|
3
|
+
# v0.18.0 (2022-11-14)
|
|
4
|
+
|
|
5
|
+
- *BREAKING*: Removes support for `globalLexicals`.
|
|
6
|
+
To our knowledge, there are no production uses for `globalLexicals`.
|
|
7
|
+
They currently could leak because `moduleLexicals` and `globalLexicals`
|
|
8
|
+
used the same scope object, so properties of one would leak to the other
|
|
9
|
+
with crafted modules.
|
|
10
|
+
We had an opportunity to plug the leak at the cost of a fifth scope
|
|
11
|
+
in all evaluators, but elected to remove the unnecessary complexity instead.
|
|
12
|
+
|
|
13
|
+
# v0.17.0 (2022-10-24)
|
|
14
|
+
|
|
15
|
+
- Previous versions of SES would leak the proxy used to isolate evaluated
|
|
16
|
+
code to functions added to the global object by guest code.
|
|
17
|
+
The value of `this` in such functions should be `undefined`, but that is not
|
|
18
|
+
possible to emulate in this shim.
|
|
19
|
+
This version changes the value of `this` in such functions to be the same as
|
|
20
|
+
`globalThis` of the compartment, as would be correct in sloppy mode.
|
|
21
|
+
- Removes experimental support for "known scope proxies".
|
|
22
|
+
|
|
3
23
|
# v0.16.0 (2022-10-19)
|
|
4
24
|
|
|
5
25
|
- When hardening a typed array, detects and locks down properties named as
|
package/README.md
CHANGED
|
@@ -465,8 +465,7 @@ not a module.
|
|
|
465
465
|
|
|
466
466
|
```js
|
|
467
467
|
const transforms = [addCodeCoverageInstrumentation];
|
|
468
|
-
const
|
|
469
|
-
const c = new Compartment({ console }, null, { transforms, globalLexicals });
|
|
468
|
+
const c = new Compartment({ console, coverage }, null, { transforms });
|
|
470
469
|
c.evaluate('console.log("Hello");');
|
|
471
470
|
```
|
|
472
471
|
|
|
@@ -503,11 +502,9 @@ and modules converted to programs, pass them as `__shimTransforms__`
|
|
|
503
502
|
instead of `transforms`.
|
|
504
503
|
|
|
505
504
|
```js
|
|
506
|
-
const __shimTransforms__ = [
|
|
507
|
-
const
|
|
508
|
-
const c = new Compartment({ console }, null, {
|
|
505
|
+
const __shimTransforms__ = [addCoverage];
|
|
506
|
+
const c = new Compartment({ console, coverage }, null, {
|
|
509
507
|
__shimTransforms__,
|
|
510
|
-
globalLexicals
|
|
511
508
|
});
|
|
512
509
|
c.evaluate('console.log("Hello");');
|
|
513
510
|
```
|