ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Editorial: Arrange contents consistently

Open ben-allen opened this issue 1 year ago • 3 comments
trafficstars

Resolves the following aspects of #405:

Placed Prototype Object properties in the following order for all Intl Objects:

  1. Intl.Foo.prototype.constructor
  2. Intl.Foo.prototype.resolvedOptions ()
  3. Intl.Foo.prototype [ %Symbol.toStringTag% ]
  4. ...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.

ben-allen avatar Sep 12 '24 12:09 ben-allen

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?

anba avatar Sep 12 '24 12:09 anba

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.

gibson042 avatar Sep 12 '24 20:09 gibson042

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

ben-allen avatar Oct 11 '24 18:10 ben-allen

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.

ben-allen avatar Nov 01 '24 20:11 ben-allen