-
Notifications
You must be signed in to change notification settings - Fork 3
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
throw on non-Symbols #9
Comments
Predicate functions don't typically throw on any input - if it's not a symbol, then logically it's not a well-known symbol - how is the question unanswerable? |
Some existing precedent is (If we went with prototype methods, or accessors, then I would definitely expect throwing if the receiver isn't a symbol) |
Ah, I was thinking of the question "is this Symbol well-known", not "is this a Symbol that is well-known" (probably because the name is just |
It already is named that imo, since it’s on “Symbol” - its common use will have the words “Symbol is well known”, which would make that name redundant. We can certainly discuss it in plenary tho. |
The "Symbol is well-known" reading is exactly why I thought it should throw for non-Symbols. I think the difference here is whether the "is" is followed by a noun or an adjective. |
I see your logic, but i don’t agree with it; a predicate should never throw. I’d expect Array.isEmpty to have an implied “is array” as well. It could return undefined instead of false in these cases, though, since that’s falsy. |
The proposal achieved stage 2 today. Are you content with returning false for non-symbols, or is this a strongly held opinion? |
I think this is something I'd like to hear opinions on from the broader committee. |
Gotcha, then I should have asked that today. I'll see if I can squeeze in an overflow item. |
@ljharb You can try sharing the thread on Matrix first or something. |
good call, i'll do both! |
Rough consensus in plenary today was to keep them non-throwing, but to rename them to |
I don't think these predicates should produce a Boolean result for non-Symbols. Receiving a
false
implies that we could answer the question but the question is, in fact, unanswerable.The text was updated successfully, but these errors were encountered: