Commit 59f8fcc
fix(ocap-kernel): inject global/globalThis into SES compartment for Rolldown CJS compat
Rolldown-generated IIFE bundles include CJS helper code that uses
`var localThis = globalThis` to access intrinsics, and some bundled
libraries (e.g. lodash) detect the global object via
`typeof global == "object" && global` or `Function("return this")()`.
In a SES Compartment:
- `global` and `self` are not named bindings
- `Function("return this")()` returns undefined in strict mode
Inject `globalThis` and `global` on the compartment's own global after
construction so these patterns resolve to the compartment's global object
(which exposes all the hardened intrinsics).
Also fix the openclaw-plugin integration test to call `register.register()`
rather than treating the PluginEntry object itself as a function.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 82d796f commit 59f8fcc
4 files changed
Lines changed: 13 additions & 38 deletions
File tree
- packages
- evm-wallet-experiment/test/integration
- ocap-kernel/src/vats
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
48 | 59 | | |
49 | 60 | | |
50 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3970 | 3970 | | |
3971 | 3971 | | |
3972 | 3972 | | |
3973 | | - | |
3974 | 3973 | | |
3975 | 3974 | | |
3976 | 3975 | | |
| |||
7767 | 7766 | | |
7768 | 7767 | | |
7769 | 7768 | | |
7770 | | - | |
| 7769 | + | |
7771 | 7770 | | |
7772 | 7771 | | |
7773 | 7772 | | |
| |||
9736 | 9735 | | |
9737 | 9736 | | |
9738 | 9737 | | |
9739 | | - | |
9740 | | - | |
9741 | | - | |
9742 | | - | |
9743 | | - | |
9744 | | - | |
9745 | | - | |
9746 | 9738 | | |
9747 | 9739 | | |
9748 | 9740 | | |
| |||
14971 | 14963 | | |
14972 | 14964 | | |
14973 | 14965 | | |
14974 | | - | |
14975 | | - | |
14976 | | - | |
14977 | | - | |
14978 | | - | |
14979 | | - | |
14980 | | - | |
14981 | | - | |
14982 | | - | |
14983 | | - | |
14984 | | - | |
14985 | | - | |
14986 | | - | |
14987 | | - | |
14988 | 14966 | | |
14989 | 14967 | | |
14990 | 14968 | | |
| |||
15695 | 15673 | | |
15696 | 15674 | | |
15697 | 15675 | | |
15698 | | - | |
15699 | | - | |
15700 | | - | |
15701 | | - | |
15702 | | - | |
15703 | | - | |
15704 | | - | |
15705 | | - | |
15706 | | - | |
15707 | | - | |
15708 | | - | |
15709 | | - | |
15710 | | - | |
15711 | 15676 | | |
15712 | 15677 | | |
15713 | 15678 | | |
| |||
0 commit comments