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

Editorial: Add %GeneratorPrototype% and %AsyncGeneratorPrototype% well-known intrinsics (#3230) #3238

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

arai-a
Copy link
Contributor

@arai-a arai-a commented Dec 5, 2023

This supersedes #3234

This is effectively same as #3234, but in order to avoid the readability issue, added dedicate well-known intrinsics for Generator prototype and Async generator prototype, that's used in the same way as %SetIteratorPrototype%.

  • All occurrences of "Generator Prototype" and "Generator.prototype" are replaced with %GeneratorPrototype%
  • All occurrences of "AsyncGenerator Prototype" and "AsyncGenerator.prototype" are replaced with %AsyncGeneratorPrototype%
  • Related ids are updated, with moving the old ids into oldids attribute
  • Also tweaked the description of Generator and AsyncGenerator to avoid the confusion from "instance of"+"generator function"

@ljharb
Copy link
Member

ljharb commented Dec 6, 2023

We generally are trying not to add any more top-level intrinsics, but I agree this might improve readability.

@michaelficarra michaelficarra added the editor call to be discussed in the next editor call label Dec 6, 2023
@michaelficarra
Copy link
Member

This will also have to update figure 6: https://tc39.es/ecma262/#figure-2

@arai-a
Copy link
Contributor Author

arai-a commented Dec 8, 2023

This will also have to update figure 6: https://tc39.es/ecma262/#figure-2

Just to make sure, it's is the following parts, right?

  • %GeneratorFunction.prototype.prototype% in the green box at the middle-right
    • technically this is still correct, but adding %GeneratorPrototype% in the box can make it clearer
  • "... to its generator function's instances" in the pink box at the bottom-center
    • replace with "... to generators created by calling its generator function", for clarity

The following seems to be slightly unclear, but it matches to other parts:

  • "abstract constructor of Generator instances" in the pink box at the middle-center
    • "Generator" and "Generator instances" are used in the same meaning. Generator Objects's 2nd paragraph also mentions "Generator instances"
    • maybe replace with "abstract constructor of generators" ?

Then, there seems to be no SVG file.
I'm happy to create a new one if necessary.

@michaelficarra
Copy link
Member

@arai-a The source for that image is at https://github.com/tc39/ecma262/blob/main/figure-2.uxf

spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
@arai-a
Copy link
Contributor Author

arai-a commented Dec 8, 2023

I tried modifying the figure-2.uxf file, but that format doesn't seem to preserve the font face across environments,
and I cannot generate an equivalent PNG file.

I use UMLet 15.1 downloaded from https://www.umlet.com/index.html on Linux (Ubuntu).
The font it's using on my environment seems to be different than the current PNG file's one, and the text overflows from the box.
I can modify the box size and line wrapping to make it "good" on my environment, and then generate PNG file, but the uxf file won't look good on other environments.

What should I do?
I'm leaning toward replacing it with SVG, that's more portable...

@michaelficarra
Copy link
Member

Replacing it with an SVG is also fine. If you do, please do so as a separate PR.

@arai-a arai-a force-pushed the generator-prototype-intrinsic branch from 87df814 to 6f212d6 Compare December 10, 2023 14:18
@michaelficarra michaelficarra removed the editor call to be discussed in the next editor call label Dec 20, 2023
@arai-a arai-a force-pushed the generator-prototype-intrinsic branch from 6f212d6 to 92dfe49 Compare January 12, 2024 12:33
@arai-a
Copy link
Contributor Author

arai-a commented Jan 12, 2024

Updated the SVG figure, replacing %GeneratorFunction.prototype.prototype% with %GeneratorPrototype%, and also tweaking the layout to make it centered again (it's shifted by #3239 to make the content fit)

Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the new section IDs are mostly unnecessary and just bloat the document with oldids. Otherwise LGTM.

@arai-a arai-a force-pushed the generator-prototype-intrinsic branch from 92dfe49 to 96d7e7f Compare January 13, 2024 07:23
@arai-a
Copy link
Contributor Author

arai-a commented Jan 13, 2024

reverted ids, and updated %AsyncGeneratorFunction% description

@arai-a arai-a requested a review from jmdyck January 27, 2024 14:40
Copy link
Collaborator

@jmdyck jmdyck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me.

@arai-a
Copy link
Contributor Author

arai-a commented Jan 31, 2024

I'm not sure what happened, but "1 change requested" is still there.
I don't see any unresolved comment.

@jmdyck
Copy link
Collaborator

jmdyck commented Jan 31, 2024

Apparently, resolving all comments doesn't make "1 change requested" go away. Instead, the change-requesting review must be either dismissed or replaced with an approval.

spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Feb 21, 2024
…own intrinsics, use instead of {,Async}Generator.prototype (tc39#3238)

 - Use "generator function" instead of "generator" for GeneratorFunction instances
@ljharb ljharb force-pushed the generator-prototype-intrinsic branch from 84ea7dd to fdde1c9 Compare February 21, 2024 23:12
@ljharb ljharb merged commit fdde1c9 into tc39:main Feb 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants