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

Disallow non-attribute frozen arrays #1413

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 26, 2024

Also an an example of how to specify frozen array attributes.

Closes #1399.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

Also an an example of how to specify frozen array attributes.

Closes #1399.

The <code>favoriteFoods</code> [=getter steps=] are to return [=this=]'s favorite foods.

The <code>favoriteFoods</code> [=setter steps=] are to set [=this=]'s favorite foods to [=the given value=].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just works? So if it's not frozen it ends up throwing or some such?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversion steps for JS values to Web IDL FrozenArray<T> types will take any iterable, iterate over it, grab the values into an Infra list, then create a JS array from them, then freeze it, then package it up into a FrozenArray<T> pointer. So yeah, it just works.

@domenic domenic merged commit 4035d0a into main Jul 2, 2024
2 checks passed
@domenic domenic deleted the frozenarray-restrictions branch July 2, 2024 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Disallow FrozenArray<> in argument lists, and maybe dictionaries and return types
2 participants