Open jmdyck opened 4 years ago
@jmdyck Thank you for your suggestion. We'll consider the appropriate organisation after we've completed #1950.
The editors haven't really made any progress here on our preference, and given other efforts this reorg is of pretty low priority. In the interest of not doing work that we won't get cycles to review anytime soon, perhaps you'd want to hold off on doing work here, @jmdyck.
I'll continue to hold off.
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
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.