Skip to content

Commit bf45161

Browse files
committed
Throw, instead of assert, for transferring detached ArrayBuffers
This makes the algorithm more user-friendly, as this is generally the desired behavior, and the algorithm can already throw for other reasons so callers are expected to handle that.
1 parent 3fb6ab4 commit bf45161

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.bs

+4-2
Original file line numberDiff line numberDiff line change
@@ -9060,7 +9060,8 @@ a reference to the same object that the IDL value represents.
90609060

90619061
1. Let |jsArrayBuffer| be the result of [=converted to a JavaScript value|converting=]
90629062
|arrayBuffer| to a JavaScript value.
9063-
1. Assert: [$IsDetachedBuffer$](|jsArrayBuffer|) is false.
9063+
1. If [$IsDetachedBuffer$](|jsArrayBuffer|) is false, then [=JavaScript/throw=] a
9064+
<l spec=ecmascript>{{TypeError}}</l>.
90649065
1. Let |arrayBufferData| be |jsArrayBuffer|.\[[ArrayBufferData]].
90659066
1. Let |arrayBufferByteLength| be |jsArrayBuffer|.\[[ArrayBufferByteLength]].
90669067
1. Perform [=?=] [$DetachArrayBuffer$](|jsArrayBuffer|).
@@ -9073,7 +9074,8 @@ a reference to the same object that the IDL value represents.
90739074
value of type {{ArrayBuffer}}.
90749075

90759076
<p class="note">This will throw an exception under the same circumstances as
9076-
[=ArrayBuffer/detaching=].
9077+
[=ArrayBuffer/detaching=], and also for {{ArrayBuffer}}s that are already
9078+
[=BufferSource/detached=].
90779079
</div>
90789080

90799081
<h4 id="js-frozen-array" oldids="es-frozen-array">Frozen arrays — FrozenArray&lt;|T|&gt;</h4>

0 commit comments

Comments
 (0)