-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
allow operation with dense array for Backbone collection #2802
Conversation
I'm not sure we should encourage passing undefined models to a collection since it will screw up most of the collection's methods. What's your use case? |
I agree. But, it was supported till Backbone v1.0.0. You can try that out same example with Backbone v1.0.0 and v1.1.0. And |
In that case I'd consider it a fixed bug in Backbone 1.0.0. Absent a good use case, I think this should stay fixed. |
This was introduced by the changes in #2755... Although this behavior wasn't documented, it might not be bad to either discard the empty values (as is done elsewhere, like events), or assume that an empty value is an empty object, as would be the case in this pull request. |
Since you can do @jdkanani - can you add a few more tests to cover the cases you provided above? |
We'll need a better implementation, though. |
|
No, something clearer and less incidental.
Should do it. |
Oh right, of course :) |
@tgriesser @jashkenas Added one more commit for test cases and better fix. |
allow operation with dense array for Backbone collection
It throws
TypeError
for collection operations with Backbone v1.1.0.