[heycam/webidl] Is [AllowShared] applicable to BufferSource? (#1008)

[3.3.1 \[AllowShared\]](https://heycam.github.io/webidl/#AllowShared) EXAMPLE 59 shows an example that applies `[AllowShared]` to `BufferSource` type, which is a union type and not a buffer source type.  Since `[AllowShared]` is applicable only to buffer source types, this example looks wrong to me.

I think that the following statements are related.

[3.3.1 \[AllowShared\]](https://heycam.github.io/webidl/#AllowShared)

> A type that is not a buffer source type must not be associated with the [AllowShared] extended attribute.

[2.13. Types](https://heycam.github.io/webidl/#idl-types)

> The buffer source types are ArrayBuffer, DataView, and the typed array types.

> The typed array types are Int8Array, Int16Array, Int32Array, Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray, BigInt64Array, BigUint64Array, Float32Array, and Float64Array.

My understanding is that `BufferSource` is a union type and not a buffer source type, hence `BufferSource` must not be associated with `[AllowShared]`.  Probably we'd like to define `BufferSourceAllowShared` as a typedef for convenience?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/1008

Received on Wednesday, 4 August 2021 09:33:27 UTC