fix(immutable-arraybuffer): update to recent spec #2688
Merged
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: tc39/proposal-immutable-arraybuffer#26
Refs: https://github.com/tc39/proposal-immutable-arraybuffer tc39/proposal-immutable-arraybuffer#15 tc39/proposal-immutable-arraybuffer#9 tc39/proposal-immutable-arraybuffer#16
Description
Since the last work on this immutable-arraybuffer shim, at the tc39 plenary we decided that
transferToImmutable
should take an optionalnewLength
parameter, to stay parallel to the othertransfer*
methods.sliceToImmutable
method should be added.The spec at https://github.com/tc39/proposal-immutable-arraybuffer and the Moddable XS implementation both already reflect these changes. This PR brings this shim up to date with those changes, closing tc39/proposal-immutable-arraybuffer#26
Security Considerations
none
Scaling Considerations
none
Documentation Considerations
The proposal's draft spec has already been updated.
Testing Considerations
New tests lightly test the new functionality. The code and tests may differ from the current draft spec on order of operations and errors thrown. But since these issues are purposely still open tc39/proposal-immutable-arraybuffer#16 , this divergence is not yet a big deal.
Compatibility Considerations
No more than the baseline shim already on master.
Upgrade Considerations
No production code yet depends on this shim. So, none.