-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
_.isEmpty, _.size, etc. fail for ES2015 Set objects #2627
Comments
I agree. In the short term, we should have a logic branch for |
Considering taking a crack at it. Slightly daunted by the need to redefine core functions (e.g. |
@jonathaneunice Two tips I would give:
|
Duplicate of #2147. |
Underscore returns incorrect results for
Set
objects. E.g. believes they are empty when they are not. I assume other Underscore functions for iteration, inclusion testing, and so on will similarly fail.Several open issues mention ES2015
Set
andMap
(e.g. this one); none seem the same as this bug. Reading source for v1.9.0, it seems to rely ondefaultKeys
(alias forObject.keys
).Object.keys
does not produce keys forSet
objects, so this is likely to fail in the same ways it does now. Similarly_.size
seems to rely on the the.length
property, whichSet
does not have; it has an idiosyncratic.size
property instead, which the source does not seem to query.Set
objects are new, and seem very immature. Still, when JS fails to do the right thing, I look to Underscore to make things right, or at least a little more logical. Hoping that a near release can help wrangle the new structures.The text was updated successfully, but these errors were encountered: