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

Find a replacement for indirect field reference #865

Open
gibson042 opened this issue Feb 27, 2024 · 1 comment
Open

Find a replacement for indirect field reference #865

gibson042 opened this issue Feb 27, 2024 · 1 comment

Comments

@gibson042
Copy link
Contributor

ECMA-262 editors are opposed to accepting Record [[<fieldName>]] syntax, and for good reason. We should strive to minimize its use in ECMA-402, and ideally eliminate it altogether. One possibility that comes to mind is introduction of a Dictionary specification type, such that record.[[<fieldName>]] could be replaced with e.g. dict[fieldName] or DictionaryGet(dict, fieldName). This would also improve our ability to address #81, in particular by separating spec values that have static keys (which would mostly remain Records) from those with dynamic keys such as the values of constructor [[LocaleData]] slots (which would become Dictionaries).

@ryzokuken
Copy link
Member

ryzokuken commented Feb 28, 2024

@gibson042 the idea of introducing dictionaries to avoid using records like this makes a lot of sense to me. If it's acceptable to the 262 editors and can be added to ecmarkup, let's do it.

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

No branches or pull requests

2 participants