Skip to content
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

Consistify spelling of realm #8353

Closed
annevk opened this issue Oct 4, 2022 · 1 comment · Fixed by #8356
Closed

Consistify spelling of realm #8353

annevk opened this issue Oct 4, 2022 · 1 comment · Fixed by #8356
Labels
clarification Standard could be clearer

Comments

@annevk
Copy link
Member

annevk commented Oct 4, 2022

There's Realm and realm, JavaScript Realm and JavaScript realm, and various others.

https://tc39.es/ecma262/#realm is lowercase. Should we align with that? The exception here would be internal slots, but I think we can safely lowercase the remainder.

Also, do we generally want to use JavaScript realm or just realm?

(Stumbled across this due to whatwg/fetch#1343 which could still be changed.)

@annevk annevk added the clarification Standard could be clearer label Oct 4, 2022
@domenic
Copy link
Member

domenic commented Oct 5, 2022

Good catch.

The difference between "realm" and "Realm": the latter is supposed to refer to the concrete specification type, more properly known as a "Realm Record". The former is more about the concept. Having both is probably not necessary. I guess I prefer "realm" > "Realm Record " > "Realm".

I kind of like the clarity of the JavaScript prefix, but I don't think its really worth keeping. Prefixing external concepts with their spec names is pretty rare, and nothing else is using the term "realm".

So my vote is for s/(?:JavaScript )?[Rr]ealm(?: Record)?/realm/g, including in the definitions of existing concepts.

A potential wrinkle is that the JS spec defines "the current Realm Record" (which we seem to always refer to without the "the" prefix). Maybe we can alias it to "current realm" as part of importing it.

annevk added a commit that referenced this issue Oct 5, 2022
This does not fix "creating a new JavaScript realm" as it might have external callers.

Fixes #8353.
annevk added a commit that referenced this issue Oct 6, 2022
Corresponding Service Worker PR: w3c/ServiceWorker#1659.

Fixes #8353.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

Successfully merging a pull request may close this issue.

2 participants