feat(compartment-mapper): add retainAll flag to captureFromMap #2893
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #2886
Ref: #2894 (future implementation may make this PR unnecessary)
Description
This adds a boolean flag to
captureFromMap()
which instructsdigestCompartmentMap()
to ignore theretained
flag onCompartmentDescriptor
s andModuleDescriptor
s, which ensures no "unused"CompartmentDescriptor
is dropped from the mapping.Considered creating a new public function for this, but it did not seem worth the bother. Still, it would be feasible to:
captureAllFromMap()
captureFromMap()
into a new module-scoped functioncaptureFromMap()
andcaptureAllFromMap()
captureAllFromMap()
would passretainAll: true
to the common function which would hand it off todigestCompartmentMap()
Security Considerations
n/a
Scaling Considerations
Use of this will result in a large compartment map, which may bloat whatever you're using it for.
Documentation Considerations
n/a
Testing Considerations
Added fixture and tests for the specific behavior with and without the flag.
Compatibility Considerations
This is backwards-compatible.
Upgrade Considerations
Update
NEWS.md