tc39 / ecma402

Status, process, and documents for ECMA 402

Home Page:https://tc39.es/ecma402/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Find a replacement for indirect field reference

gibson042 opened this issue · comments

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).

@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.