Skip to content

Normative: add Iterator.zip and Iterator.zipKeyed#3802

Open
michaelficarra wants to merge 7 commits into
mainfrom
joint-iteration
Open

Normative: add Iterator.zip and Iterator.zipKeyed#3802
michaelficarra wants to merge 7 commits into
mainfrom
joint-iteration

Conversation

@michaelficarra
Copy link
Copy Markdown
Member

@michaelficarra michaelficarra commented Apr 7, 2026

@michaelficarra michaelficarra added normative change Affects behavior required to correctly evaluate some ECMAScript source text pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4. labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

The rendered spec preview for this PR is available as a single page at https://tc39.es/ecma262/pr/3802 and as multiple pages at https://tc39.es/ecma262/pr/3802/multipage .

Jack-Works added a commit to engine262/engine262 that referenced this pull request Apr 11, 2026
Comment thread spec.html Outdated
Comment thread spec.html
Comment on lines +48641 to +48642
1. If _mode_ is *"longest"*, then
1. Set _paddingOption_ to ? Get(_options_, *"padding"*).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a bit odd to read padding only when mode is "longest" (rather than unconditionally), but it was present from the start and is covered in test262. I'm not objecting, but do want to draw attention to this behavior.

Comment thread spec.html
Comment thread spec.html
Comment thread spec.html Outdated
@linusg linusg added has stage 4 This PR represents a proposal that has achieved stage 4, and is ready to merge. and removed pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. labels May 26, 2026
@michaelficarra michaelficarra added the editor call to be discussed in the next editor call label May 27, 2026
@michaelficarra michaelficarra removed the editor call to be discussed in the next editor call label May 28, 2026
@michaelficarra michaelficarra requested a review from a team May 29, 2026 21:11
Comment thread spec.html Outdated
Comment thread spec.html Outdated
@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Jun 1, 2026
Comment thread spec.html Outdated
Comment thread spec.html Outdated

<emu-clause id="sec-iterator.zip">
<h1>Iterator.zip ( _iterables_ [ , _options_ ] )</h1>
<p>This method performs the following steps when called:</p>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<p>This method performs the following steps when called:</p>
<p>This function performs the following steps when called:</p>

... because it's not a property of a prototype and doesn't reference *this*? (There's nothing in Editorial Conventions to say.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could add an editorial convention for this if we can come up with a good rule.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For some earlier discussion, see issue #2576.

Comment thread spec.html Outdated
Comment thread spec.html Outdated
Comment thread spec.html Outdated
Comment thread spec.html Outdated
Comment thread spec.html Outdated
@jmdyck
Copy link
Copy Markdown
Collaborator

jmdyck commented Jun 1, 2026

Oh, I forgot to mention: it's unusual to have the section for an AO (in this case IteratorZip) appear as a child of a "Properties of the X" section.

@michaelficarra michaelficarra removed the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Jun 1, 2026
@michaelficarra
Copy link
Copy Markdown
Member Author

Oh, I forgot to mention: it's unusual to have the section for an AO (in this case IteratorZip) appear as a child of a "Properties of the X" section.

This seems like the most appropriate place, though. Where would you put it?

@michaelficarra michaelficarra added the editor call to be discussed in the next editor call label Jun 1, 2026
@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Jun 1, 2026
@jmdyck
Copy link
Copy Markdown
Collaborator

jmdyck commented Jun 1, 2026

This seems like the most appropriate place, though. Where would you put it?

Precedent elsewhere in the spec would suggest nesting it within the section for Iterator.zip or Iterator.zipKeyed.

E.g.,

  • The AO ObjectDefineProperties is invoked by functions Object.create and Object.defineProperties, and is nested within the latter.
  • The AO ThisBooleanValue is invoked by Boolean.prototype.toString and Boolean.prototype.valueOf, and is nested within the latter.
  • The AO ThisSymbolValue is invoked by Symbol.prototype.valueOf and Symbol.prototype [ %Symbol.toPrimitive% ], and is nested within the former.
  • Similarly with GetOwnPropertyKeys, ThisNumberValue, ThisBigIntValue, StringPaddingBuiltinsImpl, GetSubstitution, TrimString, ThisStringValue, etc.

Alternatively, the spec sometimes puts AOs in an "Abstract Operations for Foo" section after the "Properties of Foo" section.

@gibson042
Copy link
Copy Markdown
Member

Alternatively, the spec sometimes puts AOs in an "Abstract Operations for Foo" section after the "Properties of Foo" section.

I like this approach.

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

Labels

editor call to be discussed in the next editor call has stage 4 This PR represents a proposal that has achieved stage 4, and is ready to merge. normative change Affects behavior required to correctly evaluate some ECMAScript source text proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4. 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.

Stage 4 tracking

5 participants