ecma402
ecma402 copied to clipboard
Editorial: Arrange contents consistently
Resolves the following aspects of #405:
Placed Prototype Object properties in the following order for all Intl Objects:
- Intl.Foo.prototype.constructor
- Intl.Foo.prototype.resolvedOptions ()
- Intl.Foo.prototype [ %Symbol.toStringTag% ]
- ...Foo-specific properties in alphabetic order...
Gathered all Abstract Operations associated with each Object into the Abstract Operations section for that Object. Previously Intl.DateTimeFormat, Intl.Locale, and Intl.NumberFormat had several Abstract Operations appear inside the constructor clauses of those Objects.
ECMA-262 sorts built-in properties alphabetically, with Symbol-keyed properties being sorted to the end. Does it make sense to follow in ECMA-402?
I'm ambivalent about that, especially dropping resolvedOptions at a varying position for each prototype—there's something to be said for a simple rule, but also for tweaking that rule to highlight internal consistency. On balance, I think I prefer the latter, ideally including documentation justifying it.
My preference strongly matches @gibson042's -- resolvedOptions in predictable place, add text to the style guide explaining the choice. Should we discuss it at TG2? @anba
pushed a commit addressing @gibson042 concerns, largely through dropping the commit that moved constructor-specific AOs down to the section with the rest of the AOs.