endo
endo copied to clipboard
feat(ses): add aggregateLoadErrors flag
Refs: #2820
Description
This adds the aggregateLoadErrors flag to the Compartment constructor in its CompartmentOptions. The default value of this flag is true, which retains the current behavior.
If false, this will cause the first error encountered during load (load or loadNow) to be thrown or rejected.
~~A second PR (or subsequent commit in this PR) will thread this flag through
@endo/compartment-mapperwhere it can more easily be provided (e.g., toimportLocation(),loadFromMap(), etc.).~~ This won't be strictly necessary for@lavamoat/node's use-case, so I'd rather just kick the can down the road until it's needed.
Security Considerations
none that I'm aware of
Scaling Considerations
n/a
Documentation Considerations
The aggregateLoadErrors flag should be documented w/ the rest of CompartmentOptions.
Testing Considerations
This has tests which cover both load and loadNow cases.
Compatibility Considerations
non-breaking
Upgrade Considerations
- [ ] Update
NEWS.mdfor user-facing changes.