Skip to content

feat(ses): ArrayBuffer.prototype.transferToImmutable#2400

Merged
erights merged 3 commits intomasterfrom
markm-to-immutable-3
May 1, 2025
Merged

feat(ses): ArrayBuffer.prototype.transferToImmutable#2400
erights merged 3 commits intomasterfrom
markm-to-immutable-3

Conversation

@erights
Copy link
Copy Markdown
Contributor

@erights erights commented Aug 7, 2024

Closes: #XXXX
Refs: #XXXX

Description

Now that the Immutable ArrayBuffer proposal is at 2.7 and looks likely to proceed to 3, and then on to 4 and the official language, we are now allowing ourselves to build on the shim to emulate it already being in the language. In this PR ses imports the shim (not just the ponyfill) and then permits it's additions as harmless for ses users.

Security Considerations

We carefully designed the proposal to maintain our high security standards. Likewise, in our shim, an Immutable ArrayBuffer encapsulates a normal mutable ArrayBuffer. But it is careful not to mutate it or to let it escape. The shim is low fidelity in terms of what it must practically omit --- TypedArrays and DavaView backed by Immutable ArrayBuffers. But these omissions do not raise security hazards, only compat hazards.

Scaling Considerations

Because Immutable ArrayBuffers obviate the need for defensive copying and support safe zero-copy sharing, it will help scalability.

  • When on XS, we should somehow arrange to use its high-speed high-fidelity highly tested Immutable ArrayBuffer implementation. We should also figure out our migration strategy as other engines of interest ship their own standards compliant implementations. All these steps will help scaling immensely. But it is unclear how to handle the transition.

Documentation Considerations

Mostly, we can just point at the docs for Immutable ArrayBuffer itself, currently in the proposal and soon in the JS standard.

Testing Considerations

The XS native Immutable ArrayBuffer implementation is also highly tested by the test262 tests in the PR they submitted, which will also test other native implementations.

  • Our shim is not highly tested. We should somehow test it against the relevant subset of those submitted test262 tests.

Compatibility Considerations

The shim is low fidelity in terms of what it omits from the standard. The shim is also low fidelity in that it cannot hide an internal shim implementation artifact, the hidden prototype that all and only Immutable ArrayBuffers share. A correct implementation of the proposal will have no such extra prototype object.

Upgrade Considerations

  • Update NEWS.md for user-facing changes.

@erights erights changed the base branch from master to markm-to-immutable-2 August 7, 2024 03:48
@erights erights changed the title Markm to immutable 3 feat(ses): ArrayBuffer.p.transferToImmutable Aug 7, 2024
@erights erights changed the title feat(ses): ArrayBuffer.p.transferToImmutable feat(ses): ArrayBuffer.prototype.transferToImmutable Aug 7, 2024
@erights erights force-pushed the markm-to-immutable-2 branch from c1d8ab4 to f531bc8 Compare August 7, 2024 18:43
@erights erights force-pushed the markm-to-immutable-3 branch from 4390c1c to 86d38ba Compare August 7, 2024 18:46
@erights erights force-pushed the markm-to-immutable-2 branch from f531bc8 to 262bcf0 Compare August 13, 2024 17:44
Base automatically changed from markm-to-immutable-2 to master August 13, 2024 18:59
@erights erights force-pushed the markm-to-immutable-3 branch from 86d38ba to c9c9300 Compare August 16, 2024 21:54
@erights erights force-pushed the markm-to-immutable-3 branch 2 times, most recently from 19de016 to 5972da3 Compare September 7, 2024 20:31
@erights erights force-pushed the markm-to-immutable-3 branch from 5972da3 to 1e582fb Compare October 14, 2024 19:30
@erights erights force-pushed the markm-to-immutable-3 branch from 1e582fb to b32ab45 Compare October 29, 2024 00:01
@erights erights force-pushed the markm-to-immutable-3 branch from b32ab45 to 544a213 Compare November 17, 2024 00:50
@erights erights force-pushed the markm-to-immutable-3 branch 2 times, most recently from d0f1cd5 to bc99d9e Compare January 15, 2025 23:18
@erights erights force-pushed the markm-to-immutable-3 branch from bc99d9e to 0509bcc Compare February 17, 2025 03:22
@erights erights requested a review from kumavis April 30, 2025 02:30
@erights erights self-assigned this Apr 30, 2025
@erights erights requested a review from kriskowal April 30, 2025 02:46
@erights erights force-pushed the markm-to-immutable-3 branch from 0509bcc to 07017b0 Compare April 30, 2025 02:51
@erights erights marked this pull request as ready for review April 30, 2025 03:01
@erights erights force-pushed the markm-to-immutable-3 branch from e2fd1ff to 75ea396 Compare May 1, 2025 21:30
@erights erights requested a review from leotm May 1, 2025 21:55
Copy link
Copy Markdown
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Officially approving this PR, but it's also implicitly covered by #1538 (review) .

@erights erights merged commit d714d1d into master May 1, 2025
16 checks passed
@erights erights deleted the markm-to-immutable-3 branch May 1, 2025 22:36
boneskull pushed a commit that referenced this pull request Jun 4, 2025
Closes: #XXXX
Refs: #XXXX

## Description

Now that the Immutable ArrayBuffer proposal is at 2.7 and looks likely
to proceed to 3, and then on to 4 and the official language, we are now
allowing ourselves to build on the shim to emulate it already being in
the language. In this PR ses imports the shim (not just the ponyfill)
and then permits it's additions as harmless for ses users.

### Security Considerations

We carefully designed the proposal to maintain our high security
standards. Likewise, in our shim, an Immutable ArrayBuffer encapsulates
a normal mutable ArrayBuffer. But it is careful not to mutate it or to
let it escape. The shim is low fidelity in terms of what it must
practically omit --- TypedArrays and DavaView backed by Immutable
ArrayBuffers. But these omissions do not raise security hazards, only
compat hazards.

### Scaling Considerations

Because Immutable ArrayBuffers obviate the need for defensive copying
and support safe zero-copy sharing, it will help scalability.

- [ ] When on XS, we should somehow arrange to use its high-speed
high-fidelity highly tested Immutable ArrayBuffer implementation. We
should also figure out our migration strategy as other engines of
interest ship their own standards compliant implementations. All these
steps will help scaling immensely. But it is unclear how to handle the
transition.

### Documentation Considerations

Mostly, we can just point at the docs for Immutable ArrayBuffer itself,
currently in the proposal and soon in the JS standard.

### Testing Considerations

The XS native Immutable ArrayBuffer implementation is also highly tested
by the test262 tests in the PR they submitted, which will also test
other native implementations.

- [ ] Our shim is not highly tested. We should somehow test it against
the relevant subset of those submitted test262 tests.

### Compatibility Considerations

The shim is low fidelity in terms of what it omits from the standard.
The shim is also low fidelity in that it cannot hide an internal shim
implementation artifact, the hidden prototype that all and only
Immutable ArrayBuffers share. A correct implementation of the proposal
will have no such extra prototype object.

### Upgrade Considerations

- [x] Update `NEWS.md` for user-facing changes.

---------

Co-authored-by: LeoTM <1881059+leotm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants