-
Notifications
You must be signed in to change notification settings - Fork 101
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
Notation for internal slot, property, dictionary access #165
Comments
So afaik it's:
|
Property and dictionary access seem reasonably well-defined by ES and Web IDL. Internal slots are tricky since many web specs have effectively borrowed the notion from ES without a formal definition that applies beyond the ES |
Another thing worth noting, although again hard to say whether something so ecosystem-specific belongs in Infra, is that in most web specs, it'll be supremely rare to use ES Get() notation, because everything will have been converted to e.g. a dictionary, instead of needing raw property access. |
Maybe Infra isn't the right doc for it, but it'd be nice if somewhere, there were a "web spec notation beginner's guide", or at least a designated, "look at this particular spec--it's in the most modern form". I'm not sure how someone is supposed to start out when there are so many documents. |
You may be interested in https://docs.google.com/document/d/1cRVD1k-hDBGfLVwTG14P_ZqJLM4d5-Z4vpwYFb_4qks/edit?usp=sharing , which is a rough draft collection of resources I once wrote up for someone else. |
My impression is that the editors' consensus has moved away from talking about internal properties as "slots" (like we used in Streams), and now prefers using HTML's pattern of "An X 'has a' cc/ @dlaliberte and @tabatkins |
I think for the web platform that is correct as it's a bit more readable without the square brackets. There are of course places such as Web IDL and certain algorithms in HTML that need internal slots for parity with JS. |
Oh, I wasn't aware the consensus had shifted. I've used slots in a lot of my specs to refer to the internal value of an attribute. However we do it, tho, we should formalize in IDL and/or Infra. |
Yes. I regret introducing the unnecessarily-complex internal slot notation, along with its implications from ES, into the ecosystem. My bad; I was young and thought that the ES spec was the best spec ever. |
I'm not sure if this is all out of the scope of the infra spec, but it's a point of confusion for me as a new web spec author: I'm never quite sure what the right notation is for three things:
object's \[\[Foo]] internal slot
vsobject.\[\[Foo]]
)? Get(object, "property")
vsobject.property
vs something in between)dictionary.member
vs I'm not sure)If this guide, or some other specification (WebIDL?) could clarify, that would be helpful. It's hard for me to figure this out from current specs, as I've been corrected on style issues even when taking style directly from other recent specs.
cc @tobie
The text was updated successfully, but these errors were encountered: