New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Realm's field records start with an uppercase code point #393

Closed
annevk opened this Issue Feb 15, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@annevk
Contributor

annevk commented Feb 15, 2016

It seems in general field records start with an uppercase code point. Therefore it should probably be [[GlobalObject]] and such.

@jmdyck

This comment has been minimized.

Show comment
Hide comment
@jmdyck

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).

Collaborator

jmdyck commented Feb 16, 2016

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).

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

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.

Contributor

annevk commented Feb 17, 2016

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.

@bterlson

This comment has been minimized.

Show comment
Hide comment
@bterlson

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.

Member

bterlson commented Feb 17, 2016

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.

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Feb 17, 2016

Member

Another place this comes up is Intl, which uses lower-case.

Member

littledan commented Feb 17, 2016

Another place this comes up is Intl, which uses lower-case.

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Feb 23, 2016

Contributor

@bterlson do you want a PR for starting all fields and slots with an uppercase code point?

Contributor

annevk commented Feb 23, 2016

@bterlson do you want a PR for starting all fields and slots with an uppercase code point?

@bterlson

This comment has been minimized.

Show comment
Hide comment
@bterlson

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.

Member

bterlson commented Feb 23, 2016

@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.

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