close
Skip to content

tests for Iterator.prototype.join#4768

Open
bakkot wants to merge 1 commit into
mainfrom
iterator-join
Open

tests for Iterator.prototype.join#4768
bakkot wants to merge 1 commit into
mainfrom
iterator-join

Conversation

@bakkot
Copy link
Copy Markdown
Member

@bakkot bakkot commented Dec 8, 2025

Fixes #4697.

Tested against a polyfill.

@bakkot bakkot requested review from a team as code owners December 8, 2025 03:03
Comment thread test/built-ins/Iterator/prototype/join/separator-tostring.js
Iterator.prototype.join.call(it, throwy);
});

assert.sameValue(gotNext, false);
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.

Suggested change
assert.sameValue(gotNext, false);
assert(!gotNext);

?

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.

Arguably this is more readable in terms of the failures you get. Certainly it is not worse. In any case I don't think it's worth changing.

var coercible = {
toString: function () {
if (called) {
throw new Test262Error('toString should be called exactly once');
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.

To assert exactly-once behaviour, I would just use a counter and assert on the counter at the end.

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.

That is also a valid way to do it but I'm happy with this as-is.

lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 28, 2026
These are from tc39/test262#4768 which is
currently under review. Once the tests land upstream, these can be
removed. This will be handled as part of shipping the feature when
it reaches Stage 3.

Differential Revision: https://phabricator.services.mozilla.com/D296726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test plan for Iterator.prototype.join

4 participants