Skip to content

Commit

Permalink
Normative: Allow transferring SharedArrayBuffer objects
Browse files Browse the repository at this point in the history
  • Loading branch information
leobalter committed Oct 29, 2021
1 parent b23dbc7 commit e9d11a9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,27 @@ <h1>GetWrappedValue ( _callerRealm_, _value_ )</h1>
<emu-alg>
1. Assert: _callerRealm_ is a Realm Record.
1. If Type(_value_) is Object, then
1. If IsCallable(_value_) is *false*, throw a TypeError exception.
1. Return ! WrappedFunctionCreate(_callerRealm_, _value_).
1. If IsCallable(_value_) is *true*,
1. Return ! WrappedFunctionCreate(_callerRealm_, _value_).
1. If _value_ has an [[ArrayBufferData]] internal slot, then
1. If IsSharedArrayBuffer(_value_) if *true*, return ? CloneSharedArrayBuffer(_value_, _callerRealm_.[[Intrinsics]].%SharedArrayBuffer%).
1. throw a TypeError exception.
1. Return _value_.
</emu-alg>
</emu-clause>

<emu-clause id="sec-validateshadowrealmobject" aoid="ValidateShadowRealmObject">
<h1>CloneSharedArrayBuffer ( _buffer_, _constructor_ )</h1>
<emu-alg>
1. Assert: _buffer_ is an Object with a [[SharedArrayBuffer]] internal.
1. Let _clone_ be ? OrdinaryCreateFromConstructor(_constructor_, "%SharedArrayBuffer.prototype%", « [[ArrayBufferData]], [[ArrayBufferByteLength]] »).
1. Assert: _value_ and _clone_ are instances of SharedArrayBuffer of different Realms each.
1. Set _clone_.[[ArrayBufferData]] to _value_.[[ArrayBufferData]].
1. Set _clone_.[[ArrayBufferByteLength]] to _value_.[[ArrayBufferByteLength]].
1. Return _clone_.
</emu-alg>>
</emu-clause>

<emu-clause id="sec-validateshadowrealmobject" aoid="ValidateShadowRealmObject">
<h1>ValidateShadowRealmObject ( _O_ )</h1>
<p>The abstract operation ValidateShadowRealmObject takes argument _O_. It performs the following steps when called:</p>
Expand Down

0 comments on commit e9d11a9

Please sign in to comment.