-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
wrap jquery's deferred[ resolveWith | rejectWith | notifyWith ] #268
Conversation
@@ -72,4 +72,19 @@ $.ajax = function ravenAjaxWrapper(url, options) { | |||
} | |||
}; | |||
|
|||
var _oldDeferred = $.Deferred; | |||
$.Deferred = function ravenDeferredWrapper(func) { |
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.
Wouldn't we want to check that $.Deferred
is not undefined
first? Or does it not matter?
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.
Worst case is that it introduces (a broken) $.Deferred
when it wasn't there before. But yeah, I'd probably leave it if it's not defined.
Aside, $.Deferred
was introduced in jQuery 1.5 in 2011.
@matghaleb Is it possible to supply a test case for this? Even if it's a jsfiddle or something functional. This is a very highly used plugin and I'd be afraid of breaking it without actually testing it. |
@mattrobenolt, I just updated my pull request fixing some bugs and supporting more jQuery versions. you can test the new plugin from this jsfiddle: (working fine from jQuery 1.6.4 to 2.1.0) and compare the results with the current version: |
Look interesting... But some unit test could be awesome. 👍 |
- wrap deferred[resolve | reject | promise] for pre-1.9
7e183a1
to
8f9930e
Compare
No isolation, but basic functional test for one func in fa86837 |
Not entirely sure of how best to improve the tests. Ideally we'd:
|
New implementation of previous PR #266