-
-
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
Fix wrong context passed in collection.create #4284
Conversation
@jgonggrijp can you check this and confirm that it's indeed a bug? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is a bug and I also agree with your fix. 👍
This bug needs a regression test, could you add it?
In any case, thanks for reporting and fixing!
I've tried that, but I don't know how to test that case properly. My test succeeded when it should have failed. :) |
Alright, in that case I will do it myself some time in the near future. |
Thanks a lot |
@olhapi Please remove the changes to (I'm working on the regression test in the meanwhile.) |
@jgonggrijp done, just pushed. |
Here https://github.com/jashkenas/backbone/blob/master/backbone.js#L1088
this
has the wrong context, it refers to a window object in the browser because we didn't pass a previously saved collection context to it.