Re: [whatwg/webidl] Disallow FrozenArray<> in argument lists, and maybe dictionaries and return types (Issue #1399)

> > Similarly, it never makes sense to use FrozenArray<> as a type for an "input" dictionary. You should always use sequences.
> 
> Can you explain a bit more why it doesn't make sense? Also if this doesn't make sense, what would be the recommendation of `FrozenArray` in the AudioWorkletProcesor's `process()`? The original intention was to clarify that the array passed by the audio renderer is not mutable by the user code.

I assume you wanted to ask about using them as types for arguments, since that's the case for Web Audio (not a dictionary). Note that Web Audio's use case is a bit special, since it's using them for a callback which needs argument conversion from WebIDL to ECMAScript. I think the main concern for this issue is avoiding the conversion from ECMAScript to WebIDL for arguments, but callbacks also use WebIDL argument lists. Removing them from argument lists in general will break the callback case too, which is why it would nice to remove that particular callback.

Regardless of whether Web Audio needs to use a `FrozenArray` for performance reasons, see the discussion in [2581](https://github.com/WebAudio/web-audio-api/issues/2581) on why you might not actually need the WebIDL callback in the first place.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1399#issuecomment-2036778565
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1399/2036778565@github.com>

Received on Thursday, 4 April 2024 10:20:48 UTC