Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMake Realm's field records start with an uppercase code point #393
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jmdyck
Feb 16, 2016
Collaborator
The spec is split on this matter.
In the following record-types, each field name starts with a lowercase letter:
Completion (type, value, target)
Iterator (iterator, done)
Realm (intrinsics, globalObject, globalEnv, templateMap)
TemplateMap entry (strings, array)
Method definition (key, closure)
GlobalSymbolRegistry (key, symbol)
And in these, it's uppercase:
PropertyDescriptor
PendingJob
Script
Module
Source Text Module
ImportEntry
ExportEntry
PromiseCapability
PromiseReaction
In Function Environment Record, it's mixed.
If we're going for consistency, I think I'd prefer lowercase, because then field names would be lexically distinct from internal slot names (modulo [[name]] and [[env]] of ArgGetter and ArgSetter).
|
The spec is split on this matter. In the following record-types, each field name starts with a lowercase letter: And in these, it's uppercase: In Function Environment Record, it's mixed. If we're going for consistency, I think I'd prefer lowercase, because then field names would be lexically distinct from internal slot names (modulo [[name]] and [[env]] of ArgGetter and ArgSetter). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
annevk
Feb 17, 2016
Contributor
Can we change [[name]] and [[env]] to become [[Name]] and [[Env]] then? I would be okay with such a convention. @bterlson?
The reason I'm raising this by the way is whatwg/html#638 where HTML introduces its own set of internal slots and fields. I suspect that eventually we'll revamp IDL and it'll become relevant there too.
|
Can we change [[name]] and [[env]] to become [[Name]] and [[Env]] then? I would be okay with such a convention. @bterlson? The reason I'm raising this by the way is whatwg/html#638 where HTML introduces its own set of internal slots and fields. I suspect that eventually we'll revamp IDL and it'll become relevant there too. |
annevk
referenced this issue
Feb 17, 2016
Merged
Define security around Window, WindowProxy, and Location properly #638
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bterlson
Feb 17, 2016
Member
I'm not sure there's much value in having a lexical distinction between fields and slots. I'd be ok saying that anything inside double-brackets should start with uppercase, personally.
|
I'm not sure there's much value in having a lexical distinction between fields and slots. I'd be ok saying that anything inside double-brackets should start with uppercase, personally. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Another place this comes up is Intl, which uses lower-case. |
bterlson
added
the
editorial change
label
Feb 17, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
annevk
Feb 23, 2016
Contributor
@bterlson do you want a PR for starting all fields and slots with an uppercase code point?
|
@bterlson do you want a PR for starting all fields and slots with an uppercase code point? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bterlson
Feb 23, 2016
Member
@annevk Yeah sure, if you'd like to put one together I'd take it! Orthogonally, if we want a lexical distinction between slots and fields then we should come up with something other than [[ ]] for one or the other.
|
@annevk Yeah sure, if you'd like to put one together I'd take it! Orthogonally, if we want a lexical distinction between slots and fields then we should come up with something other than [[ ]] for one or the other. |
annevk commentedFeb 15, 2016
It seems in general field records start with an uppercase code point. Therefore it should probably be [[GlobalObject]] and such.