Open gibson042 opened 4 years ago
This seems straightforward and it can help prevent errors when merging proposals, implementing the spec, etc. It should be done in a quiet time when there are not other big PRs open.
Is there still interest in abstracting away the duplicative constructor code? I'm a big fan of the idea, but given that different Intl Objects have different options reads interspersed through those sections, the most straightforward way to abstract it out would require normative changes to the order of those options reads.
Is there still interest in abstracting away the duplicative constructor code?
Yes, I'd still love to see that.
I'm a big fan of the idea, but given that different Intl Objects have different options reads interspersed through those sections, the most straightforward way to abstract it out would require normative changes to the order of those options reads.
I think we can get pretty far editorially... AFAICT, there's variation only on
new
), and...all of which can be parameterized in a common constructor operation.
We can also get even further if normative changes are on the table to e.g. snapshot options objects early in construction, which would be great but should wait for completion of the editorial part so we can better assess the impact of such changes.
Suggested template for Foo functionality:
The biggest differences of this as compared to http://tc39.es/ecma402/ are in the ordering under "Properties of the Intl.Foo Prototype Object" (which currently all go like "constructor", "@@toStringTag", ..., "resolvedOptions") and in pushing abstract operations to be after the references to them (rather than before the Constructor definition as they are now).
It also looks like a great deal of the constructor code could be abstracted:
"localeMatcher"
,"string"
, «"lookup"
,"best fit"
»,"best fit"
).