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

NaN should throw TypeError instead of yield an empty range #60

Closed
Jack-Works opened this issue Dec 2, 2022 · 3 comments
Closed

NaN should throw TypeError instead of yield an empty range #60

Jack-Works opened this issue Dec 2, 2022 · 3 comments

Comments

@Jack-Works
Copy link
Member

Originally posted by @ljharb in #59 (comment)

@ljharb
Copy link
Member

ljharb commented Dec 2, 2022

Specifically because it's definitely a bug, and it should fail early and loudly.

@bakkot
Copy link
Contributor

bakkot commented Dec 2, 2022

See also tc39/proposal-iterator-helpers#169 and tc39/proposal-temporal#2112, where we agreed on rejecting NaN and things which coerce to NaN (unless they have some other meaning pre-coercion, of course).

In tc39/proposal-iterator-helpers#181 we did decide on a RangeError rather than a TypeError, though.

@ljharb
Copy link
Member

ljharb commented Dec 2, 2022

I agree a RangeError is more appropriate.

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

No branches or pull requests

3 participants