-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ses): Tame ModuleSource #2469
Conversation
Agoric SDK integration probe Agoric/agoric-sdk#10144 |
1bfee1b
to
dba7bec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I don't understand. lockdown
calls the repair, to repair things once we have a ModuleSource
, whether natively or via the shim. But what brings in the shim? I expected lockdown
to do that as well.
Why is everything failing under CI? |
It looks like adding
We do not bring in the ModuleSource shim unconditionally because it entrains Babel, so Lockdown must work whether there’s a native ModuleSource, shimmed ModuleSource, or none at all. |
36e96c1
to
635e630
Compare
635e630
to
4702335
Compare
I’ve restructured this change around addIntrinsics and tameModuleSource instead of any code in getAnonymousIntrinsics. I learned that we need to bind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Refs: #2463, #2252
Description
In #2463 we introduced ModuleSource to the SES permits, but this interacted catastrophically with the native XS ModuleSource. We reverted this change #2468 to unbreak Agoric SDK integration. This change reintroduces the ModuleSource permits, such that they are compatible with both XS and the
@endo/module-source/shim.js
, which anticipates the introduction of an AbstractModuleSource base class. Because SES can more gracefully tolerate the absence of an permitted [[Proto]] than the presence of a non-permitted [[Proto]], this adjusts the shim to ensure that the AbstractModuleSource shape exists as a side-effect of repairs/taming, before permits are applied.Security Considerations
None.
Scaling Considerations
None.
Documentation Considerations
This change reintroduces a note in NEWS.md for the next release.
Testing Considerations
The prior regression went unnoticed because we did not yet have CI for XS #2465. With this change,
yarn test:xs
in SES validates the shim on XS. We also test@endo/module-source/shim.js
inses/test/module-source.test.js
on Node.js.Compatibility Considerations
This change is designed to tolerate either path forward for the language, whether or not it accepts an AbstractModuleSource base class.
Upgrade Considerations
None.