Closed domenic closed 7 months ago
I recall some old guidance around using frozen arrays in return values. It might've been misapplied here.
Is there any compat risk in changing this?
The IDL issue calls out the plausible use case of "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." - a quick glance at the Chromium impl it doesn't look like we're caching.
The compat risk should be minimal - it would depend on a caller receiving the array via the output dictionary, and relying on it being immutable. Not impossible, but unlikely.
We're hoping to remove support for dictionaries containing frozen arrays, in https://github.com/whatwg/webidl/issues/1399. It's not clear why this spec makes the array objects immutable, when the dictionaries themselves are (like all dictionaries) mutable.