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

update constructor and Symbol.toStringTag properties on Iterator.prototype #3970

Merged
merged 7 commits into from
Jan 15, 2024

Conversation

michaelficarra
Copy link
Member

Updates tests for these two properties to match tc39/proposal-iterator-helpers#287.

Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Coming back to this after the winter break, I don't see a revert of this on the agenda among the other iterator topics for February 2024, so I think we should assume it's not changing in the short term and should merge it.

@ptomato ptomato force-pushed the iterator-helpers-weird-setters branch from 59176fc to d6572a7 Compare January 15, 2024 23:36
@ptomato ptomato enabled auto-merge (squash) January 15, 2024 23:38
@ptomato ptomato merged commit 17ba9ae into main Jan 15, 2024
9 checks passed
@ptomato ptomato deleted the iterator-helpers-weird-setters branch January 15, 2024 23:40
enumerable: false,
configurable: true,
});
verifyConfigurable(Iterator.prototype, Symbol.toStringTag);
Copy link
Contributor

Choose a reason for hiding this comment

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

This test and the corresponding one for constructor property are broken. verifyConfigurable() calls isConfigurable() that deletes the property. So, the subsequent parts of this test fail because the property is not there anymore.

If you want to use verifyConfigurable() then it should be the last statement of the test.


// 1. If _this_ is not an Object, then
// 1. Throw a *TypeError* exception.
assert.throws(() => set.call(undefined, ''));
Copy link
Contributor

Choose a reason for hiding this comment

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

This test and the corresponding one for constructor property are broken. The first argument of assert.throws() should be the expected error (i.e. TypeError in this case).

@ptomato
Copy link
Contributor

ptomato commented Jan 19, 2024

@iamstolis Thanks for catching these, would you mind opening an issue, otherwise the comments will probably get lost 😄

@iamstolis
Copy link
Contributor

@iamstolis Thanks for catching these, would you mind opening an issue, otherwise the comments will probably get lost 😄

Done: #3993.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants