Skip to content

Editorial: Reorganize clauses 6 through 9 #2148

Open

Description

It's a bit odd to me that after discussing objects in 6.1.7 (The Object Type), we talk about some non-object stuff, and then go back to objects in clause 9 (Ordinary and Exotic Objects Behaviours).

Similarly, it's odd that after discussing spec types in 6.2, we talk about other stuff, and then go back to spec types in clause 8 (Executable Code and Execution Contexts).

(In fact, 6.2.6 (The Environment Record Specification Type) is basically just a pointer to 8.1 (Environment Records). So env records "belong" in both places? If we were adding a new spec type, how would we decide whether it goes in 6.2 or 8?)

I suggest reorganizing clauses 6 through 9, so that there's one top-level clause for ES language types, and one for ES spec types.

The result might look something like the following. (Clauses are shown here with their current number and title for ease of reference. Numbers would of course change, titles might change. The order of sibling clauses could be adjusted to taste.)

  • ECMAScript Language Types and Values

    • 6.1.1 The Undefined Type

    • ...

    • 6.1.6 Numeric Types

    • 6.1.7 The Object Type

      • 6.1.7.1 Property Attributes
      • 6.1.7.2 Object Internal Methods and Internal Slots
      • 6.1.7.3 Invariants of the Essential Internal Methods
      • 9.1 Ordinary Object Internal Methods and Internal Slots
      • 9.2 ECMAScript Function Objects
      • 9.3 Built-in Function Objects
      • 9.4 Built-in Exotic Object Internal Methods and Slots
      • 9.5 Proxy Object Internal Methods and Internal Slots
      • 6.1.7.4 Well-Known Intrinsic Objects
    • 7 Abstract Ops
      [Note that everything in clause 7 deals with language values, so putting it here makes sense.]
      [Portions could be split out and moved to more specific spots. E.g. ops concerned with numeric values could move to the Numeric Types clause, ops concerned with Objects could move to the Objects clause.]

  • ECMAScript Specification Types and Values

    • 6.2.1 The List and Record Spec Types [could be split]
    • ...
    • 6.2.7 The Abstract Closure Spec Type
    • 6.2.8 Data Blocks
    • 6.2.6 The Environment Record Spec Type [merged with] 8.1 Environment Records
    • 8.2 Realms
    • ...
    • 8.12 CleanupFinalizationRegistry

I realize that this would change the position and nesting-level of ~6k lines, but Issue #1950 is contemplating a move of at least ~10k lines, so this doesn't seem outrageous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions