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

Backbone.js plugin breaks when using event map syntax for .on(). #306

Closed
jgerigmeyer opened this issue Dec 25, 2014 · 0 comments · Fixed by #307
Closed

Backbone.js plugin breaks when using event map syntax for .on(). #306

jgerigmeyer opened this issue Dec 25, 2014 · 0 comments · Fixed by #307

Comments

@jgerigmeyer
Copy link
Contributor

The Backbone.js plugin's BackboneEventsOn fn expects .on() to have been called with arguments name, callback, and context:

https://github.com/getsentry/raven-js/blob/master/plugins/backbone.js#L14-21

However, Backbone.js also supports calling .on() using the event map syntax (http://backbonejs.org/#Events-on), e.g.:

book.on({
  "change:title": titleView.update,
  "change:author": authorPane.update,
  "destroy": bookView.remove
});

This usage currently throws an error:

Uncaught TypeError: Cannot read property '_callback' of undefined

Am I missing something? I'll try to submit a PR shortly.

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

Successfully merging a pull request may close this issue.

2 participants