-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Generator.prototype is not defined #3230
Comments
This doesn't work with the current ecmarkup, because it doesn't accept a dot inside I'll see if the linter can be modified to accept the syntax. |
…erator.prototype (tc39#3230)
"Generator" is defined in the first sentence of https://tc39.es/ecma262/#sec-generator-objects, which means that "Generator.prototype.constructor", for example, is also defined. I'm confused what the problem is here. |
I was assuming that "Generator" means the |
I read that as the return value of |
In that case, |
ahh ok, on a reread "instance of a generator function" actually means It's still defined, though :-) |
The sentence says "A Generator" conforms to the Iterator interfaces and Iterable Interfaces. https://tc39.es/ecma262/#sec-generator-objects
https://tc39.es/ecma262/#sec-iterable-interface
https://tc39.es/ecma262/#sec-iterator-interface
To my understanding, Actually, "SOMETHING instance"/"instance of SOMETHING" term seems to be used in 2 ways throughout the spec, |
I agree with you that some terminology needs clarifying in this section. |
I've checked the occurrences of "generator(s)" (without explicit suffix like "generator function" or "GeneratorBody"), Sometimes "Generator" is used as abbreviation of "GeneratorFunction", but still the formal name would be "GeneratorFunction" for them. https://tc39.es/ecma262/#sec-strict-mode-code
One exception is the following, which I'm not sure if it's really intended to be abbreviation: https://tc39.es/ecma262/#table-well-known-intrinsic-objects
But anyway, defining "Generator" as a name of Then, if replacing with I haven't chosen this in the first place because I thought the dot in the Also, about the "instance of a generator function", I think we should avoid the use of the combination of "instance"+"generator function" there, because both " |
…enerator.prototype (tc39#3230)
…enerator.prototype (tc39#3230)
…enerator.prototype (tc39#3230)
…enerator.prototype (tc39#3230)
The "Generator Objects" section first mentions "A Generator is an instance of a generator function ...".
https://tc39.es/ecma262/#sec-generator-objects
Then "Properties of the Generator Prototype Object" section defines "Generator prototype object" as
%GeneratorFunction.prototype.prototype%
https://tc39.es/ecma262/#sec-properties-of-generator-prototype
The "Generator prototype object" name is used by
GeneratorFunction.prototype.prototype
's definition, which makes sense:https://tc39.es/ecma262/#sec-generatorfunction.prototype.prototype
But remaining subsections of "Generator Objects" define properties of
Generator.prototype
, that sounds like the same thing as%GeneratorFunction.prototype.prototype%
, but it's not defined explicitly:https://tc39.es/ecma262/#sec-generator.prototype.constructor
https://tc39.es/ecma262/#sec-generator.prototype.next
It also makes the first paragraph "A Generator is an instance of ..." confusing, that it sounds like
Generator
inGenerator.prototype.constructor
is "A Generator" instance (which is not true, because the instance doesn't haveprototype
property).There would be 2 options to solve this:
Generator.prototype
with%GeneratorFunction.prototype.prototype%
(while keeping the ids of those sections, to avoid breaking links)Generator.prototype
is a shorthand notation for%GeneratorFunction.prototype.prototype%
(also clarifiesGenerator
there isn't "A Generator" above)Same for
AsyncGenerator.prototype
in https://tc39.es/ecma262/#sec-asyncgenerator-objectsThe text was updated successfully, but these errors were encountered: