diff --git a/index.bs b/index.bs index 88df0b13..cddde552 100644 --- a/index.bs +++ b/index.bs @@ -5465,6 +5465,8 @@ The string types are {{DOMString}}, all [=enumeration types=], {{ByteString}} and {{USVString}}. +The buffer types are {{ArrayBuffer}} and {{SharedArrayBuffer}}. + The typed array types are {{Int8Array}}, {{Int16Array}}, @@ -5478,10 +5480,9 @@ The typed array types are {{Float32Array}}, and {{Float64Array}}. -The buffer source types -are {{ArrayBuffer}}, -{{DataView}}, -and the [=typed array types=]. +The buffer view types are {{DataView}} and the [=typed array types=]. + +The buffer source types are the [=buffer types=] and the [=buffer view types=]. The {{object}} type, all [=interface types=], and @@ -6328,27 +6329,47 @@ For any type, the [=extended attributes associated with=] it must only contain There are a number of types that correspond to sets of all possible non-null references to objects that represent a buffer of data or a view on to a buffer of -data. The table below lists these types and the kind of buffer or view they represent. +data. The table below lists these types and the kind of buffer or view they represent.
| Type | Kind of buffer |
|---|---|
| ArrayBuffer | An object that holds a pointer (which can be null) to a buffer of a fixed number of bytes |
| DataView | A view on to an {{ArrayBuffer}} that allows typed access to integers and floating point values stored at arbitrary offsets into the buffer |
| Int8Array, - Int16Array, - Int32Array, - BigInt64Array |
- A view on to an {{ArrayBuffer}} that exposes it as an array of two's complement signed integers of the given size in bits |
| Uint8Array, - Uint16Array, - Uint32Array, - BigUint64Array |
- A view on to an {{ArrayBuffer}} that exposes it as an array of unsigned integers of the given size in bits |
| Uint8ClampedArray | -A view on to an {{ArrayBuffer}} that exposes it as an array of unsigned 8-bit integers with clamped conversions |
| Float32Array, - Float64Array |
- A view on to an {{ArrayBuffer}} that exposes it as an array of IEEE 754 floating point numbers of the given size in bits |
| Type + | Kind of buffer + |
| ArrayBuffer + | An object that holds a pointer (which can be null) to a buffer of a fixed number of bytes + |
| SharedArrayBuffer + | An object that holds a pointer (which cannot be null) to a shared buffer of a fixed number of bytes + |
| DataView + | A view on to a [=buffer type=] instance that allows typed access to integers and floating point values stored at arbitrary offsets into the buffer + |
| Int8Array + | A view on to a [=buffer type=] instance that exposes it as an array of two's complement signed integers of the given size in bits + |
| Int16Array + | |
| Int32Array + | |
| BigInt64Array + | |
| Uint8Array + | A view on to a [=buffer type=] instance that exposes it as an array of unsigned integers of the given size in bits + |
| Uint16Array + | |
| Uint32Array + | |
| BigUint64Array + | |
| Uint8ClampedArray + | A view on to a [=buffer type=] instance that exposes it as an array of unsigned 8-bit integers with clamped conversions + |
| Float32Array + | A view on to a [=buffer type=] instance that exposes it as an array of IEEE 754 floating point numbers of the given size in bits + |
| Float64Array |
BufferRelatedType :
"ArrayBuffer"
+ "SharedArrayBuffer"
"DataView"
"Int8Array"
"Int16Array"
@@ -8388,12 +8410,20 @@ that correspond to the union's [=member types=].
[=implements=], then return the IDL value that is a reference to the object |V|.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
- 1. If Type(|V|) is Object and |V| has an \[[ArrayBufferData]] [=/internal slot=], then:
+ 1. If Type(|V|) is Object, |V| has an \[[ArrayBufferData]]
+ [=/internal slot=], and IsSharedArrayBuffer(|V|) is false, then:
1. If |types| includes {{ArrayBuffer}}, then return the
result of [=converted to an IDL value|converting=]
|V| to {{ArrayBuffer}}.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
+ 1. If Type(|V|) is Object, |V|, has an \[[ArrayBufferData]]
+ [=/internal slot=], and IsSharedArrayBuffer(|V|) is true, then:
+ 1. If |types| includes {{SharedArrayBuffer}}, then return the
+ result of [=converted to an IDL value|converting=]
+ |V| to {{SharedArrayBuffer}}.
+ 1. If |types| includes {{object}}, then return the IDL value
+ that is a reference to the object |V|.
1. If Type(|V|) is Object and |V| has a \[[DataView]] [=/internal slot=], then:
1. If |types| includes {{DataView}}, then return the
result of [=converted to an IDL value|converting=]
@@ -8480,33 +8510,45 @@ that correspond to the union's [=member types=].
Buffer source types
-Values of the IDL [=buffer source types=]
-are represented by objects of the corresponding ECMAScript class, with the following additional restrictions on those objects.
+A value of an IDL {{ArrayBuffer}} is represented by an object of the corresponding ECMAScript class.
+If it is not [=extended attributes associated with|associated with=] the [{{AllowResizable}}]
+[=extended attribute=], it can only be backed by ECMAScript {{ArrayBuffer}}
+objects |V| for which IsResizableArrayBuffer(|V|) is false.
+
+A value of an IDL {{SharedArrayBuffer}} is represented by an object of the corresponding ECMAScript
+class. If it is not [=extended attributes associated with|associated with=] the [{{AllowResizable}}]
+[=extended attribute=], it can only be backed by ECMAScript
+{{SharedArrayBuffer}} objects |V| for which
+IsResizableArrayBuffer(|V|) is false.
+
+Values of the IDL [=buffer view types=] are represented by objects of the corresponding ECMAScript
+class, with the following additional restrictions on those objects.
This will throw an exception if |esArrayBuffer| has an \[[ArrayBufferDetachKey]] @@ -8728,8 +8805,8 @@ a reference to the same object that the IDL value represents.
typedef (ArrayBuffer or SharedArrayBuffer or [AllowShared] ArrayBufferView) AllowSharedBufferSource;+ +The {{AllowSharedBufferSource}} typedef is used to represent objects +that are either themselves an {{ArrayBuffer}} or {{SharedArrayBuffer}} or which +provide a view on to an {{ArrayBuffer}} or {{SharedArrayBuffer}}. + +