Guidance for nested namespace objects

Philip Chimento
Igalia, in partnership with Bloomberg
TC39 July 2021

Top-level namespace objects

  • Should be capitalized (e.g. Math, Temporal)
  • Should have a @@toStringTag (June 2020 plenary)

Nested namespace objects

  • Temporal.now? Temporal.Now?
  • Temporal.now[Symbol.toStringTag] == 'Temporal.now'?

Proposal

  • Provide explicit guidance in how-we-work that both top-level and nested namespaces should
    • be capitalized
    • have a @@toStringTag equal to the fully qualified name

Asking the plenary for (1/2)

  • Consensus on the points on the previous slide?
    • ✅ @@toStringTag equal to the fully qualified name
    • ❓ capitalization
      • Definition of namespace? "I know it when I see it"?
      • "The convention for how they are capitalized or spelled usually is derived from the kind of thing they are, not where they are put." — Shu

Asking the plenary for (2/2)

  • Consensus on making this change in any current proposals?
  • A volunteer to write this up in how-we-work?