ses 0.14.3 → 0.14.5
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/NEWS.md +23 -1
- package/dist/lockdown.cjs +4826 -4863
- package/dist/lockdown.mjs +4826 -4863
- package/dist/lockdown.umd.js +4826 -4863
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses.cjs +4826 -4863
- package/dist/ses.mjs +4826 -4863
- package/dist/ses.umd.js +4826 -4863
- package/dist/ses.umd.min.js +1 -1
- package/package.json +6 -7
- package/src/compartment-evaluate.js +58 -28
- package/src/compartment-shim.js +44 -27
- package/src/global-object.js +33 -26
- package/src/lockdown-shim.js +15 -9
- package/src/make-eval-function.js +3 -5
- package/src/make-function-constructor.js +3 -4
- package/src/make-safe-evaluator.js +117 -0
- package/src/scope-handler.js +13 -2
- package/src/transforms.js +1 -1
- package/CHANGELOG.md +0 -220
- package/src/evaluate.js +0 -102
package/CHANGELOG.md
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
### [0.14.3](https://github.com/endojs/endo/compare/ses@0.14.2...ses@0.14.3) (2021-09-18)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* **eslint-plugin:** Add no-polymorphic-call rule ([03e8c5f](https://github.com/endojs/endo/commit/03e8c5f566a52d9d6e7fb9d876a67347ecf37324))
|
|
12
|
-
* **ses:** Lockdown option domainTaming ([ee3e4c3](https://github.com/endojs/endo/commit/ee3e4c309ece70249d6c95b806ca8d02549f1837))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Bug Fixes
|
|
16
|
-
|
|
17
|
-
* **ses:** Fix reflexive imports ([d259db7](https://github.com/endojs/endo/commit/d259db75022941c4ea1881b4ca4005acc1a37a1c))
|
|
18
|
-
* **ses:** Search engine optimization ([#886](https://github.com/endojs/endo/issues/886)) ([ef03184](https://github.com/endojs/endo/commit/ef031843b445a4a9df7b717fba7a315371eadae0))
|
|
19
|
-
* add "name" to moderate override of all errors ([#867](https://github.com/endojs/endo/issues/867)) ([d608325](https://github.com/endojs/endo/commit/d608325c3edade0c64f9ca9a84379f8d3e3addf0))
|
|
20
|
-
* update NEWS with news of [#867](https://github.com/endojs/endo/issues/867) ([#869](https://github.com/endojs/endo/issues/869)) ([c3139d2](https://github.com/endojs/endo/commit/c3139d2ff7433afce3653639fc71a65dbe3c6313))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### [0.14.2](https://github.com/endojs/endo/compare/ses@0.14.1...ses@0.14.2) (2021-08-14)
|
|
25
|
-
|
|
26
|
-
**Note:** Version bump only for package ses
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### [0.14.1](https://github.com/endojs/endo/compare/ses@0.14.0...ses@0.14.1) (2021-08-13)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### Features
|
|
36
|
-
|
|
37
|
-
* **ses:** Add permits for at methods ([#857](https://github.com/endojs/endo/issues/857)) ([8b9e138](https://github.com/endojs/endo/commit/8b9e13830113fef9c3b5a36ba88436dba5677b4c)), closes [#854](https://github.com/endojs/endo/issues/854)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## [0.14.0](https://github.com/endojs/endo/compare/ses@0.13.4...ses@0.14.0) (2021-07-22)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### ⚠ BREAKING CHANGES
|
|
45
|
-
|
|
46
|
-
* Update preamble for SES StaticModuleRecord
|
|
47
|
-
* **ses:** Adjust preamble for module instances to expect entries instead of a Map
|
|
48
|
-
|
|
49
|
-
### Features
|
|
50
|
-
|
|
51
|
-
* **ses:** Add errorTrapping lockdown option ([2a88adb](https://github.com/endojs/endo/commit/2a88adb2ac65ae401a20c2019fe61bac2d7b4fd2))
|
|
52
|
-
* **ses:** Reveal harden only after lockdown ([424af0f](https://github.com/endojs/endo/commit/424af0f0cabd28d691b3cf7183bf1a0d34f0af70)), closes [#787](https://github.com/endojs/endo/issues/787)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### Bug Fixes
|
|
56
|
-
|
|
57
|
-
* **ses:** Adjust preamble for module instances to expect entries instead of a Map ([574c518](https://github.com/endojs/endo/commit/574c518de757c34a57096ef3c5be5681249e5294))
|
|
58
|
-
* **ses:** Defend integrity of intrinsics ([14e451c](https://github.com/endojs/endo/commit/14e451ce32f95de68f10d15fe99a260dc638150d))
|
|
59
|
-
* **ses:** Fix assert type assertions ([53d284d](https://github.com/endojs/endo/commit/53d284d04eebed57ccaf19b43a1ff9a71393cc6b))
|
|
60
|
-
* **ses:** Fix packaging for `@web/dev-server` ([8c35e33](https://github.com/endojs/endo/commit/8c35e333818bd9e7f6630ae2be93e5ca98d85e17))
|
|
61
|
-
* **ses:** Fix version number errors in news ([9aff6c3](https://github.com/endojs/endo/commit/9aff6c3ca0c7cd9971879b720ca7e5ac6afff805))
|
|
62
|
-
* **ses:** Improve error messages for invalid module records ([5c07c85](https://github.com/endojs/endo/commit/5c07c850f8b3299aaa2042c4fbe0cf7116304284))
|
|
63
|
-
* **ses:** Scope proxy defense against property descriptor prototype pollution ([cbfbf85](https://github.com/endojs/endo/commit/cbfbf850139712e4ddeb97128e980353b309b4b9))
|
|
64
|
-
* **ses:** Use eslint-disable notation consistently ([#837](https://github.com/endojs/endo/issues/837)) ([6ddb50c](https://github.com/endojs/endo/commit/6ddb50c179e4b9e0645ab23bade6c3e5d3aa485e))
|
|
65
|
-
* typo vs type checker ([#798](https://github.com/endojs/endo/issues/798)) ([fcb433f](https://github.com/endojs/endo/commit/fcb433fa67584ae36b4685232259e35e7fa3b8ec))
|
|
66
|
-
* Update preamble for SES StaticModuleRecord ([790ed01](https://github.com/endojs/endo/commit/790ed01f0aa73ff2d232e69c9323ee0bb448c2b0))
|
|
67
|
-
* **ses:** Trap and report errors ([a79df15](https://github.com/endojs/endo/commit/a79df15f6dcebc8df2ddf389af605313cb1b17b0)), closes [#769](https://github.com/endojs/endo/issues/769)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
### [0.13.4](https://github.com/endojs/endo/compare/ses@0.13.3...ses@0.13.4) (2021-06-20)
|
|
72
|
-
|
|
73
|
-
**Note:** Version bump only for package ses
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### [0.13.3](https://github.com/endojs/endo/compare/ses@0.13.2...ses@0.13.3) (2021-06-16)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Features
|
|
83
|
-
|
|
84
|
-
* **ses:** Improve link errors ([71a509c](https://github.com/endojs/endo/commit/71a509cd67305b5af60d66f0b2b600ed0df8b632))
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
### [0.13.2](https://github.com/endojs/endo/compare/ses@0.13.1...ses@0.13.2) (2021-06-14)
|
|
89
|
-
|
|
90
|
-
**Note:** Version bump only for package ses
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### [0.13.1](https://github.com/endojs/endo/compare/ses@0.13.0...ses@0.13.1) (2021-06-06)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### Bug Fixes
|
|
100
|
-
|
|
101
|
-
* **ses:** Export hardener types properly ([0d2e8f0](https://github.com/endojs/endo/commit/0d2e8f0570d7de06b54b4faee56f487bbf7aeb8b))
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
## 0.13.0 (2021-06-02)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
### ⚠ BREAKING CHANGES
|
|
109
|
-
|
|
110
|
-
* **ses:** No longer supports direct use from CommonJS
|
|
111
|
-
* **static-module-record:** Emphasize RESM/NESM compatibility over CJS/UMD
|
|
112
|
-
* **ses:** Remove evaluate endowments option (#368)
|
|
113
|
-
* **ses:** Simplify transforms (#325)
|
|
114
|
-
* **ses, transform-module:** Fix StaticModuleRecord name (#323)
|
|
115
|
-
* **ses:** Surface SES on globalThis (#307)
|
|
116
|
-
|
|
117
|
-
### Features
|
|
118
|
-
|
|
119
|
-
* **ses:** Add __shimTransforms__ Compartment option ([#485](https://github.com/endojs/endo/issues/485)) ([5196521](https://github.com/endojs/endo/commit/5196521a17ac4b28f9aaaef2aa312eebe9edcbb7))
|
|
120
|
-
* **ses:** Add Compartment load function ([#349](https://github.com/endojs/endo/issues/349)) ([8352fa1](https://github.com/endojs/endo/commit/8352fa1b038ec9f6d21a1ae4b6559f687c27fd81))
|
|
121
|
-
* **ses:** add Compartment shim utility method __isKnownScopeProxy__ ([#623](https://github.com/endojs/endo/issues/623)) ([22dbe36](https://github.com/endojs/endo/commit/22dbe368d42b983a9f8b8db3d88003b5400c3e23))
|
|
122
|
-
* **ses:** Add minimal Compartment to SES-lite ([#443](https://github.com/endojs/endo/issues/443)) ([3d1dfd2](https://github.com/endojs/endo/commit/3d1dfd285a758b9be5c1de766c82a12e82329224))
|
|
123
|
-
* **ses:** Add moduleMapHook ([#419](https://github.com/endojs/endo/issues/419)) ([f053ba4](https://github.com/endojs/endo/commit/f053ba4a0ebcb9194a8ffb880359862e3748289c))
|
|
124
|
-
* **ses:** Add ModuleStaticRecord ([#279](https://github.com/endojs/endo/issues/279)) ([98c3a8f](https://github.com/endojs/endo/commit/98c3a8f0696ca1fedb865fd885f0affde388fd01))
|
|
125
|
-
* **ses:** Add news for override mistake fix ([#417](https://github.com/endojs/endo/issues/417)) ([01bf4d7](https://github.com/endojs/endo/commit/01bf4d7ef13b32e71f2d36baef573423b21e012d))
|
|
126
|
-
* **ses:** Add support for third-party modules ([#393](https://github.com/endojs/endo/issues/393)) ([0abe442](https://github.com/endojs/endo/commit/0abe442311bb4555bb06be3796f9ea77e6616b38))
|
|
127
|
-
* **ses:** Add TypeScript definitions for Compartment aux types ([07715ce](https://github.com/endojs/endo/commit/07715cea0c053cf623e9e44e03c0c331c709eb64))
|
|
128
|
-
* **ses:** Allow import and eval methods ([#669](https://github.com/endojs/endo/issues/669)) ([505a7d7](https://github.com/endojs/endo/commit/505a7d7149c36825a00c9fe3795d0f1588035dde))
|
|
129
|
-
* **ses:** Carry compartment names in error messages ([#441](https://github.com/endojs/endo/issues/441)) ([765172a](https://github.com/endojs/endo/commit/765172aa68c338947b14ec6292be18519ac14aee))
|
|
130
|
-
* **ses:** Censorship error messages may now contain the source name ([#515](https://github.com/endojs/endo/issues/515)) ([2bcd726](https://github.com/endojs/endo/commit/2bcd726ee96d53da2467eb15304531d04eb683ed))
|
|
131
|
-
* **ses:** Create a thin lockdown layer ([#406](https://github.com/endojs/endo/issues/406)) ([ff693ae](https://github.com/endojs/endo/commit/ff693ae5e012afdd8dbbec105d0da299d36fdbf9))
|
|
132
|
-
* **ses:** Create ses/lockdown alias ([17d416f](https://github.com/endojs/endo/commit/17d416f1652873c75cbd6c8fd34db37e90300ea6))
|
|
133
|
-
* **ses:** Detect invalid sloppy mode execution ([86c4751](https://github.com/endojs/endo/commit/86c4751abb7f8ce3d44b086e50ab2a5f229e12dc)), closes [#740](https://github.com/endojs/endo/issues/740)
|
|
134
|
-
* **ses:** Expand TypeScript coverage for Compartment and lockdown ([#584](https://github.com/endojs/endo/issues/584)) ([e31c86b](https://github.com/endojs/endo/commit/e31c86b407be4804bdaa719da544965ec7cb4480))
|
|
135
|
-
* **ses:** Export SES Transforms ([#608](https://github.com/endojs/endo/issues/608)) ([5ec8858](https://github.com/endojs/endo/commit/5ec8858648254e7cd2a1bf9c054a1d5d2749c31b))
|
|
136
|
-
* **ses:** Prepare to publish with TypeScript definitions ([#384](https://github.com/endojs/endo/issues/384)) ([af48adb](https://github.com/endojs/endo/commit/af48adb5b9e7cf9b5a70f3c429a1219fa99718b6))
|
|
137
|
-
* **ses:** Replace Rollup with Endo bundler ([c826f77](https://github.com/endojs/endo/commit/c826f779660f4e17713b1750c732cc381b7bb89f))
|
|
138
|
-
* **ses:** Retract evaluate name option, use sourceURL ([#521](https://github.com/endojs/endo/issues/521)) ([d1fa7ec](https://github.com/endojs/endo/commit/d1fa7ecd023ca51e4fe75b15780587aabe08c3f9))
|
|
139
|
-
* **ses:** Support global lexicals ([#356](https://github.com/endojs/endo/issues/356)) ([aefefbf](https://github.com/endojs/endo/commit/aefefbfcbe53f5b4520542bfb4da14dd68f13ec6))
|
|
140
|
-
* **ses:** Surface SES on globalThis ([#307](https://github.com/endojs/endo/issues/307)) ([3ddfb95](https://github.com/endojs/endo/commit/3ddfb953098af5c0e127a5e4dbafbed2bea43a07))
|
|
141
|
-
* **ses:** Update packaging for RESM/NESM bridge ([6abbcdc](https://github.com/endojs/endo/commit/6abbcdc847ead40aeedb2004b8317eac06047fc0))
|
|
142
|
-
* create `overrideDebug: [...props]` option ([#728](https://github.com/endojs/endo/issues/728)) ([2573c1a](https://github.com/endojs/endo/commit/2573c1a0e2ebcdad030ae29e75ef4e1bce7e5594))
|
|
143
|
-
* **ses:** Revert "Export SES Transforms ([#608](https://github.com/endojs/endo/issues/608))" ([#618](https://github.com/endojs/endo/issues/618)) ([df5739d](https://github.com/endojs/endo/commit/df5739db9237b5cd037c88001da548a63ecf9071))
|
|
144
|
-
* **ses:** Support explicit exports of third-party modules ([dfa4775](https://github.com/endojs/endo/commit/dfa47754e1c0c12e3717c57eebff020887699678))
|
|
145
|
-
* non-security mode for create-react-scripts compat. (KLUDGE) ([#642](https://github.com/endojs/endo/issues/642)) ([6bd9f03](https://github.com/endojs/endo/commit/6bd9f03ec0c138d79391ee26894e8630cf1a104f))
|
|
146
|
-
* **ses:** Support importHook alias returns ([#432](https://github.com/endojs/endo/issues/432)) ([1c8e706](https://github.com/endojs/endo/commit/1c8e7066c195d212c06a31cd91efb47c2b6a3e76))
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
### Bug Fixes
|
|
150
|
-
|
|
151
|
-
* Add pre-publish build step ([#263](https://github.com/endojs/endo/issues/263)) ([e22f094](https://github.com/endojs/endo/commit/e22f0945c901296f3f5ca1cbe357172d21f050f9))
|
|
152
|
-
* Regularize format of NEWS.md ([0ec29b3](https://github.com/endojs/endo/commit/0ec29b34a18b17cc6b90e5a46575e634714e978e))
|
|
153
|
-
* **ses:** Address charset error in integration ([17406d6](https://github.com/endojs/endo/commit/17406d6b045eefc082a17a559efdaf29293b8093))
|
|
154
|
-
* **ses:** Address Parcel need for ESM export ([fb3297e](https://github.com/endojs/endo/commit/fb3297e23236313764a0faeabe87629577370f08))
|
|
155
|
-
* **ses:** Fix intentional typo ([da3b8aa](https://github.com/endojs/endo/commit/da3b8aa85caebc70e424dd9deae0287acb25d89e))
|
|
156
|
-
* **ses:** Handle null moduleMap ([b863922](https://github.com/endojs/endo/commit/b863922f50a993201aec72bc34f91a44cc286654))
|
|
157
|
-
* **ses:** Make dist directory before bundles ([51afb2f](https://github.com/endojs/endo/commit/51afb2fdcf1a9e1f21135988da16a4b618752ca4))
|
|
158
|
-
* **ses:** Remove superfluous dev dependency on @agoric/babel-standalone ([3a278b5](https://github.com/endojs/endo/commit/3a278b51c1938774cd83510ef1b37e1f44bbd34d))
|
|
159
|
-
* **ses:** Validate third-party static module record exports ([9ec51b3](https://github.com/endojs/endo/commit/9ec51b3941b6dbdb3c7e2820753d775fc010d4ec))
|
|
160
|
-
* **static-module-record:** Emphasize RESM/NESM compatibility over CJS/UMD ([dcff87e](https://github.com/endojs/endo/commit/dcff87e6f1164d664dd31dfefb323fbbac0a8dd1))
|
|
161
|
-
* adapt whitelist to XS. clean it up too ([#549](https://github.com/endojs/endo/issues/549)) ([bd0952a](https://github.com/endojs/endo/commit/bd0952ac6569985b7a3508b257916e262b837606))
|
|
162
|
-
* add "confirm" a terminating variant of "assert" ([8929475](https://github.com/endojs/endo/commit/89294755245b0c558c8cf6423f66a1a48ec7f905))
|
|
163
|
-
* add missing testcase ([#575](https://github.com/endojs/endo/issues/575)) ([f5e1c25](https://github.com/endojs/endo/commit/f5e1c25667e0410488ed7be7684e2cb4cae9d1a6))
|
|
164
|
-
* Add missing ts-checks. Fix type errors ([#565](https://github.com/endojs/endo/issues/565)) ([52e6830](https://github.com/endojs/endo/commit/52e683091ece4c0fa4c77016c517d257d42ec7e8))
|
|
165
|
-
* assert.typeof(xxx, 'object') should assert record or null ([#603](https://github.com/endojs/endo/issues/603)) ([c84ba97](https://github.com/endojs/endo/commit/c84ba971d5fa54fe970cbf33b044b60eaceca78f))
|
|
166
|
-
* blocklist properties we expect to remove ([#614](https://github.com/endojs/endo/issues/614)) ([992f35f](https://github.com/endojs/endo/commit/992f35fdf4679faa8fb7d1c7e265c6b654156399))
|
|
167
|
-
* comment ([#561](https://github.com/endojs/endo/issues/561)) ([5e55d16](https://github.com/endojs/endo/commit/5e55d168e2cb341c22d89954a957582e813fee69))
|
|
168
|
-
* comment who needs push enabled ([#596](https://github.com/endojs/endo/issues/596)) ([1218bcd](https://github.com/endojs/endo/commit/1218bcd1b22b72f285a2236b08639c5016416afc))
|
|
169
|
-
* comments only ([#598](https://github.com/endojs/endo/issues/598)) ([1230901](https://github.com/endojs/endo/commit/1230901717c7eae50aaa0a61a058fd99c1c61928))
|
|
170
|
-
* consolidate honorary native function printing ([#392](https://github.com/endojs/endo/issues/392)) ([038bb13](https://github.com/endojs/endo/commit/038bb13f8bfb56b247875c965393c804a492c463))
|
|
171
|
-
* Consolidate lint rules ([#262](https://github.com/endojs/endo/issues/262)) ([e5ce12a](https://github.com/endojs/endo/commit/e5ce12ac4343565f2adb0e6eca5d71c6c05903bf))
|
|
172
|
-
* coordinate assert typing with agoric-sdk ([#510](https://github.com/endojs/endo/issues/510)) ([195f988](https://github.com/endojs/endo/commit/195f9887119e1a81ca35dd6f445b73241a5e7338))
|
|
173
|
-
* correct fix for override mistake ([#409](https://github.com/endojs/endo/issues/409)) ([b576211](https://github.com/endojs/endo/commit/b5762114ecd227a1c259321ab97fda3837813199))
|
|
174
|
-
* de-url-ify error codes ([#548](https://github.com/endojs/endo/issues/548)) ([b7e2e2c](https://github.com/endojs/endo/commit/b7e2e2cf51fb3ac687168310af7169a8451999f1))
|
|
175
|
-
* eslint rule to suppress bogus dependency warning ([#483](https://github.com/endojs/endo/issues/483)) ([7e3d9ea](https://github.com/endojs/endo/commit/7e3d9ea816e1626566bc2062b83cf513020f0b8d))
|
|
176
|
-
* evaluate options to evade rejections ([#546](https://github.com/endojs/endo/issues/546)) ([dec75ad](https://github.com/endojs/endo/commit/dec75adedf9b19a7fb1c53e17cbaf6e9b31e7d2b))
|
|
177
|
-
* flatten tameFunctionToString ([#482](https://github.com/endojs/endo/issues/482)) ([3d7570f](https://github.com/endojs/endo/commit/3d7570f4aa5871ed75a99d0985d5881ab9ae3af5))
|
|
178
|
-
* friendlier nested console output for browsers ([#557](https://github.com/endojs/endo/issues/557)) ([2c5c622](https://github.com/endojs/endo/commit/2c5c62285516ca8642e39791666bcc5e98adb0a4))
|
|
179
|
-
* Fully thread __shimTransforms__ through Compartment Mapper and SES ([#509](https://github.com/endojs/endo/issues/509)) ([0f199ef](https://github.com/endojs/endo/commit/0f199ef088353ec09b29e37aefcfa26a89a6c582))
|
|
180
|
-
* kill obsolete repair-legacy-accessors ([#552](https://github.com/endojs/endo/issues/552)) ([be202b9](https://github.com/endojs/endo/commit/be202b9861eb770bbae8d16948cede0a1b4f829b))
|
|
181
|
-
* Lint universal package metadata ([#266](https://github.com/endojs/endo/issues/266)) ([24ff867](https://github.com/endojs/endo/commit/24ff867adcbde89bef6b1ec702a0a8b91ad29f70))
|
|
182
|
-
* Massive intrinsic reform. Start vs other compartments. ([#372](https://github.com/endojs/endo/issues/372)) ([5cf2a20](https://github.com/endojs/endo/commit/5cf2a20389601d159b5c0683bb87bffd6bbc7b87))
|
|
183
|
-
* Move NativeErrors list to whitelist.js ([#444](https://github.com/endojs/endo/issues/444)) ([f2b8fcd](https://github.com/endojs/endo/commit/f2b8fcdf5a5f1dcaae1af93d64ebb9785f9b314b))
|
|
184
|
-
* no more detached properties ([#473](https://github.com/endojs/endo/issues/473)) ([efa990c](https://github.com/endojs/endo/commit/efa990cc12ac30aaa69f13df1ee9e1a7f3b12189))
|
|
185
|
-
* partial intrinsic reform ([#358](https://github.com/endojs/endo/issues/358)) ([9b13f73](https://github.com/endojs/endo/commit/9b13f73d282c44c11e93968332f282b5eb4372ff))
|
|
186
|
-
* remove "apply" from enablements whitelist ([#475](https://github.com/endojs/endo/issues/475)) ([b52f8d2](https://github.com/endojs/endo/commit/b52f8d22d380e048e5590ce74028f9a0070cf281))
|
|
187
|
-
* remove "debugger;" statement ([#558](https://github.com/endojs/endo/issues/558)) ([c5988e6](https://github.com/endojs/endo/commit/c5988e6a4cc576634981ba2bc152fe49a0b531f6))
|
|
188
|
-
* remove deprecated noTame options ([#328](https://github.com/endojs/endo/issues/328)) ([5d7b781](https://github.com/endojs/endo/commit/5d7b781d9b0783f7b1243898a36e30014e4662be))
|
|
189
|
-
* remove extra stackframe ([#391](https://github.com/endojs/endo/issues/391)) ([9ba5ecf](https://github.com/endojs/endo/commit/9ba5ecf019694e92ac78d98416e8c88b0e4a2cf4))
|
|
190
|
-
* rename to originalValue ([#476](https://github.com/endojs/endo/issues/476)) ([54e0b0c](https://github.com/endojs/endo/commit/54e0b0c910fd19bec14f9e3ff9e556f17f952fd4))
|
|
191
|
-
* Repair released damage caused when I merged [#552](https://github.com/endojs/endo/issues/552) ([#638](https://github.com/endojs/endo/issues/638)) ([145595c](https://github.com/endojs/endo/commit/145595c5767a6f868c13b9717a03db641e60825b))
|
|
192
|
-
* restore locale methods safely ([#382](https://github.com/endojs/endo/issues/382)) ([0a091a4](https://github.com/endojs/endo/commit/0a091a4fc87ecc9ee6aff227f7245c91d9a88852))
|
|
193
|
-
* suggested fix in [#570](https://github.com/endojs/endo/issues/570) ([#571](https://github.com/endojs/endo/issues/571)) ([3877d72](https://github.com/endojs/endo/commit/3877d72757db120cb3978ddf32a6673868dd06f0))
|
|
194
|
-
* tame Error constructor ([#359](https://github.com/endojs/endo/issues/359)) ([bfe610f](https://github.com/endojs/endo/commit/bfe610fe5fe7afd31659fc8e40ee6e77d622e264))
|
|
195
|
-
* tolerate symbols as property names ([#547](https://github.com/endojs/endo/issues/547)) ([f16bbc3](https://github.com/endojs/endo/commit/f16bbc389303eda73cd6dd1705cd667a3fc6d288))
|
|
196
|
-
* tolerate whitelist absence better ([#408](https://github.com/endojs/endo/issues/408)) ([9ed1ad8](https://github.com/endojs/endo/commit/9ed1ad87ba5380d39c47967fb7e9b52c4a2333e1))
|
|
197
|
-
* towards reconciling with agoric-sdk ([#451](https://github.com/endojs/endo/issues/451)) ([5f71e91](https://github.com/endojs/endo/commit/5f71e91c42e7b6aa2a532372d9bccef53209db46))
|
|
198
|
-
* typo ([#471](https://github.com/endojs/endo/issues/471)) ([d5742c2](https://github.com/endojs/endo/commit/d5742c234c2acf22c10b71f72fdb454fe0c6da8e))
|
|
199
|
-
* typo ([#527](https://github.com/endojs/endo/issues/527)) ([c7a3895](https://github.com/endojs/endo/commit/c7a3895100176e9b6c6e887e45181fd3a1fc2dea))
|
|
200
|
-
* Unsafe errorTaming and consoleTaming needs other adjustments ([#637](https://github.com/endojs/endo/issues/637)) ([70cc86e](https://github.com/endojs/endo/commit/70cc86eb400655e922413b99c38818d7b2e79da0))
|
|
201
|
-
* update to eslint 7.23.0 ([#652](https://github.com/endojs/endo/issues/652)) ([e9199f4](https://github.com/endojs/endo/commit/e9199f41c511b5df10593d931febdd90693b011a))
|
|
202
|
-
* use string instead of symbol for getter property ([e514a6e](https://github.com/endojs/endo/commit/e514a6ed88ccb0739ae1c03a35c1d9d57effe911))
|
|
203
|
-
* workaround remaining validation bug ([#667](https://github.com/endojs/endo/issues/667)) ([cbc3247](https://github.com/endojs/endo/commit/cbc3247bc254e1418a4398d3c1b079e4c69c2750))
|
|
204
|
-
* **326:** accept old and new taming options during transition ([#327](https://github.com/endojs/endo/issues/327)) ([67eb6e8](https://github.com/endojs/endo/commit/67eb6e8704386e022fbb1ff8f01beb40424d6dff))
|
|
205
|
-
* **ses:** Add HandledPromise to the whitelist ([#416](https://github.com/endojs/endo/issues/416)) ([a7330a8](https://github.com/endojs/endo/commit/a7330a8ce1112163982dce35d14ac8ab1ba3749f))
|
|
206
|
-
* **ses:** Aliasing true to t did not improve readability ([#360](https://github.com/endojs/endo/issues/360)) ([90a40c6](https://github.com/endojs/endo/commit/90a40c650214372d070d4c28e2d6e771d0874514))
|
|
207
|
-
* **ses:** comments ([#254](https://github.com/endojs/endo/issues/254)) ([435f1af](https://github.com/endojs/endo/commit/435f1af0b08d8dccf196b385093d629a31316b1c))
|
|
208
|
-
* **ses:** Fix lockdown layer pollution from module layer ([#472](https://github.com/endojs/endo/issues/472)) ([9a7a097](https://github.com/endojs/endo/commit/9a7a0975036d8d938263ba265f747876d7d91599))
|
|
209
|
-
* **ses:** Fix missing change to compartment load method ([42759a8](https://github.com/endojs/endo/commit/42759a8dff3b76c8f06d25904be0a58e72eeed05))
|
|
210
|
-
* **ses:** Generally import "ses/lockdown" ([#410](https://github.com/endojs/endo/issues/410)) ([6ef4a3f](https://github.com/endojs/endo/commit/6ef4a3ffe4ebd0145ca6af0edc8c04c2342e8cac))
|
|
211
|
-
* **ses:** Reform conditional tamings, especially Error ([#250](https://github.com/endojs/endo/issues/250)) ([dfa22b3](https://github.com/endojs/endo/commit/dfa22b3857f08f87f49c6ca4f51aa33fba0b1535))
|
|
212
|
-
* **ses:** regexp taming ([b010f8a](https://github.com/endojs/endo/commit/b010f8a1212aa949be8aa4970eb4ebc25aa83517)), closes [#237](https://github.com/endojs/endo/issues/237)
|
|
213
|
-
* **ses:** remove code that failed to add species ([3cfc8da](https://github.com/endojs/endo/commit/3cfc8da4646aa8306b09189dc0e202db0d633a65)), closes [#239](https://github.com/endojs/endo/issues/239)
|
|
214
|
-
* **ses:** Remove evaluate endowments option ([#368](https://github.com/endojs/endo/issues/368)) ([e7b7b6e](https://github.com/endojs/endo/commit/e7b7b6eb8d2565886f9bbf7021223bcf96dc9173))
|
|
215
|
-
* **ses:** Simplify transforms ([#325](https://github.com/endojs/endo/issues/325)) ([86a373e](https://github.com/endojs/endo/commit/86a373e008e97b2a30c25ee53df86ab120a7804b))
|
|
216
|
-
* **ses:** Spelling errors ([#362](https://github.com/endojs/endo/issues/362)) ([8f606f4](https://github.com/endojs/endo/commit/8f606f424f8b103f9ddb593d210e2e58f37430c4))
|
|
217
|
-
* **ses:** transform is an object with a rewrite method ([#255](https://github.com/endojs/endo/issues/255)) ([979fbc6](https://github.com/endojs/endo/commit/979fbc6fc9529d2b7516c9e99dcd6c1a7f4c1db3)), closes [#248](https://github.com/endojs/endo/issues/248) [#248](https://github.com/endojs/endo/issues/248)
|
|
218
|
-
* **ses:** Unravel compartment/lockdown import cycle ([#405](https://github.com/endojs/endo/issues/405)) ([b931629](https://github.com/endojs/endo/commit/b9316296ac04bd840fb434ee86a819f8717f561d))
|
|
219
|
-
* **ses:** Use CommonJS Rollup plugin ([#354](https://github.com/endojs/endo/issues/354)) ([f626365](https://github.com/endojs/endo/commit/f6263657fe7364df85cfe14e31ba1ac4dd7f03af))
|
|
220
|
-
* **ses, transform-module:** Fix StaticModuleRecord name ([#323](https://github.com/endojs/endo/issues/323)) ([10eb49a](https://github.com/endojs/endo/commit/10eb49ad499984dc44d99e84b5d59a34f1abb73b))
|
package/src/evaluate.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// Portions adapted from V8 - Copyright 2016 the V8 project authors.
|
|
2
|
-
// https://github.com/v8/v8/blob/master/src/builtins/builtins-function.cc
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
WeakSet,
|
|
6
|
-
apply,
|
|
7
|
-
immutableObject,
|
|
8
|
-
proxyRevocable,
|
|
9
|
-
weaksetAdd,
|
|
10
|
-
} from './commons.js';
|
|
11
|
-
import { getScopeConstants } from './scope-constants.js';
|
|
12
|
-
import { createScopeHandler } from './scope-handler.js';
|
|
13
|
-
import { applyTransforms, mandatoryTransforms } from './transforms.js';
|
|
14
|
-
import { makeEvaluateFactory } from './make-evaluate-factory.js';
|
|
15
|
-
import { assert } from './error/assert.js';
|
|
16
|
-
|
|
17
|
-
const { details: d } = assert;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* performEval()
|
|
21
|
-
* The low-level operation used by all evaluators:
|
|
22
|
-
* eval(), Function(), Evalutator.prototype.evaluate().
|
|
23
|
-
*
|
|
24
|
-
* @param {string} source
|
|
25
|
-
* @param {Object} globalObject
|
|
26
|
-
* @param {Objeect} localObject
|
|
27
|
-
* @param {Object} [options]
|
|
28
|
-
* @param {Array<Transform>} [options.localTransforms]
|
|
29
|
-
* @param {Array<Transform>} [options.globalTransforms]
|
|
30
|
-
* @param {bool} [options.sloppyGlobalsMode]
|
|
31
|
-
* @param {WeakSet} [options.knownScopeProxies]
|
|
32
|
-
*/
|
|
33
|
-
export const performEval = (
|
|
34
|
-
source,
|
|
35
|
-
globalObject,
|
|
36
|
-
localObject = {},
|
|
37
|
-
{
|
|
38
|
-
localTransforms = [],
|
|
39
|
-
globalTransforms = [],
|
|
40
|
-
sloppyGlobalsMode = false,
|
|
41
|
-
knownScopeProxies = new WeakSet(),
|
|
42
|
-
} = {},
|
|
43
|
-
) => {
|
|
44
|
-
// Execute the mandatory transforms last to ensure that any rewritten code
|
|
45
|
-
// meets those mandatory requirements.
|
|
46
|
-
source = applyTransforms(source, [
|
|
47
|
-
...localTransforms,
|
|
48
|
-
...globalTransforms,
|
|
49
|
-
mandatoryTransforms,
|
|
50
|
-
]);
|
|
51
|
-
|
|
52
|
-
const {
|
|
53
|
-
scopeHandler,
|
|
54
|
-
admitOneUnsafeEvalNext,
|
|
55
|
-
resetOneUnsafeEvalNext,
|
|
56
|
-
} = createScopeHandler(globalObject, localObject, {
|
|
57
|
-
sloppyGlobalsMode,
|
|
58
|
-
});
|
|
59
|
-
const { proxy: scopeProxy, revoke: revokeScopeProxy } = proxyRevocable(
|
|
60
|
-
immutableObject,
|
|
61
|
-
scopeHandler,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const constants = getScopeConstants(globalObject, localObject);
|
|
65
|
-
const evaluateFactory = makeEvaluateFactory(constants);
|
|
66
|
-
const evaluate = apply(evaluateFactory, scopeProxy, []);
|
|
67
|
-
|
|
68
|
-
admitOneUnsafeEvalNext();
|
|
69
|
-
let err;
|
|
70
|
-
try {
|
|
71
|
-
// Ensure that "this" resolves to the safe global.
|
|
72
|
-
weaksetAdd(knownScopeProxies, scopeProxy);
|
|
73
|
-
return apply(evaluate, globalObject, [source]);
|
|
74
|
-
} catch (e) {
|
|
75
|
-
// stash the child-code error in hopes of debugging the internal failure
|
|
76
|
-
err = e;
|
|
77
|
-
throw e;
|
|
78
|
-
} finally {
|
|
79
|
-
if (resetOneUnsafeEvalNext()) {
|
|
80
|
-
// Barring a defect in the SES shim, the scope proxy should allow the
|
|
81
|
-
// powerful, unsafe `eval` to be used by `evaluate` exactly once, as the
|
|
82
|
-
// very first name that it attempts to access from the lexical scope.
|
|
83
|
-
// A defect in the SES shim could throw an exception after our call to
|
|
84
|
-
// `admitOneUnsafeEvalNext()` and before `evaluate` calls `eval`
|
|
85
|
-
// internally.
|
|
86
|
-
// If we get here, SES is very broken.
|
|
87
|
-
// This condition is one where this vat is now hopelessly confused, and
|
|
88
|
-
// the vat as a whole should be aborted.
|
|
89
|
-
// No further code should run.
|
|
90
|
-
// All immediately reachable state should be abandoned.
|
|
91
|
-
// However, that is not yet possible, so we at least prevent further
|
|
92
|
-
// variable resolution via the scopeHandler, and throw an error with
|
|
93
|
-
// diagnostic info including the thrown error if any from evaluating the
|
|
94
|
-
// source code.
|
|
95
|
-
revokeScopeProxy();
|
|
96
|
-
// TODO A GOOD PLACE TO PANIC(), i.e., kill the vat incarnation.
|
|
97
|
-
// See https://github.com/Agoric/SES-shim/issues/490
|
|
98
|
-
// eslint-disable-next-line @endo/no-polymorphic-call
|
|
99
|
-
assert.fail(d`handler did not reset allowNextEvalToBeUnsafe ${err}`);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|