- From: Domenic Denicola <notifications@github.com>
- Date: Wed, 03 Apr 2024 00:48:47 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 3 April 2024 07:48:51 UTC
### What is the issue with the Web IDL Standard? Argument lists should always accept sequences, not `FrozenArray<>`s. But some specs seem to use `FrozenArray<>`s as arguments. This never makes sense. Similarly, it never makes sense to use `FrozenArray<>` as a type for an "input" dictionary. You should always use sequences. --- Other "output" cases where we might wan to disallow `FrozenArray<>`s are "output" dictionaries, and method return values. In general, such APIs should be designed so that when you vend an object to the web developer, the developer can then mutate the object if they want. Taking an extra step to freeze them is unusual and kind of silly. The exception is if some of these APIs are caching the `FrozenArray<>`s to avoid creating new JS Array values each time, for performance reasons. I'd be skeptical the performance issues here are really critical but it is a possible use case. --- I'll file a variety of issues linking back to this one to see if we can clean up the ecosystem and then implement prohibitions in the spec. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/webidl/issues/1399 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/webidl/issues/1399@github.com>
Received on Wednesday, 3 April 2024 07:48:51 UTC