Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does this spec use dictionaries containing FrozenArray<>s, instead of sequence<>s? #100

Closed
domenic opened this issue Apr 3, 2024 · 2 comments · Fixed by #101
Closed

Comments

@domenic
Copy link

domenic commented Apr 3, 2024

We're hoping to remove support for dictionaries containing frozen arrays, in whatwg/webidl#1399. It's not clear why this spec makes the array objects immutable, when the dictionaries themselves are (like all dictionaries) mutable.

@reillyeon
Copy link
Collaborator

reillyeon commented Apr 3, 2024

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?

@inexorabletash
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants