Commit Graph

26 Commits

Author SHA1 Message Date
jaubourg
23d7cf0488 Deferred: .resolve(), .reject() and .notify() now set the callback context to the promise instance rather than the deferred instance ; .then() has also been amended. Fixes #11405. 2012-12-07 15:14:12 +01:00
jaubourg
74cdd78497 deferred.promise(obj) should work with non-objects. Fixes #12521. Much needed unit tests added! 2012-09-13 15:44:12 +02:00
Richard Gibson
a101e81bde Interim take on cross-module variables, closes gh-817. 2012-06-15 21:01:44 -04:00
Rick Waldron
7c23b77af2 Strips IIFEs from modules; Always require built jQuery for tests. 2012-06-04 12:48:18 -04:00
jaubourg
f93a2f569d Preserves context objects when multiple Deferreds are passed to $.when(). Context is an array containing the original contexts in order. When non-observable value is given, associated context is undefined. In case only a single non-observable value is given, context is the global object (thanks so much Function.prototype.apply!). Fixes #11749. 2012-05-12 21:41:39 +02:00
Dave Methvin
c5fda2945c Fix #11736. Remove deprecated Deferred.isResolved/isRejected. 2012-05-11 15:02:18 -04:00
jaubourg
a1e3122706 Gains 1 more byte min/gz and reminds that isResolved and isRejected are deprecated in the comments. 2012-04-28 23:06:48 +02:00
Richard Gibson
a25721a2cd code compression 2012-04-26 16:08:17 -04:00
jaubourg
6e066a4db7 Trims down deferred.js. The gist of it is from the magnificent @gibson042, I just added some minor touches. 2012-04-25 18:25:52 +02:00
Sindre Sorhus
d5ee856a44 Remove moot second argument from slice.call()
The zeroes were added to fix http://bugs.jquery.com/ticket/4942 but those browsers are no longer supported.
2012-04-04 23:22:15 -04:00
jaubourg
a41f240674 Makes Deferred implementation truly Promise/A compliant. Unit tests amended. Actually few changes required in jQuery's own source and we gained 8 bytes minified gzipped \o/. 2012-04-02 01:29:39 +02:00
jaubourg
2a9f0681de Have Deferred.always return the object onto which it is currently attached to enable true chainability. Fixes #10723. Unit tests added. 2011-11-09 01:02:29 +01:00
Rick Waldron
a9f1346c16 Core styleguide cleanup. Fixes #10586 2011-10-26 14:58:05 -04:00
jaubourg
d29182e8d0 Removes isPending and introduces state as a means to retrieve the Deferred/Promise state. Unit tests amended. 2011-10-11 20:23:56 -04:00
jaubourg
749d32a290 isProgressing becomes isPending. Unit tests added. 2011-10-04 12:08:46 -04:00
jaubourg
a588336a6d Trimmed down $.Callbacks and $.Deferred. 2011-09-21 17:00:55 +02:00
jaubourg
4092e3d275 $.Callbacks, $.Topic and notify/progress on $.Deferred. 2011-09-19 15:42:30 -04:00
jaubourg
139135a98a Fixes #9446. Context is properly propagated using pipe. If context was the original deferred, then context is updated to next deferred in the chain. Unit tests added. 2011-07-01 01:51:50 +02:00
timmywil
39a2f29c29 Revert "Add catch block to try/finally in deferred. Fixes #9033. Test case needed." Line of exception was lost when debugging.
This reverts commit 0a80be67f4.
2011-06-08 10:55:52 -04:00
timmywil
0a80be67f4 Add catch block to try/finally in deferred. Fixes #9033. Test case needed. 2011-06-07 20:55:17 -04:00
jaubourg
8c13cfa805 Fixes #9104. Returning null or undefined in a pipe callback shouldn't end up throwing an exception. Silly, silly, me. 2011-05-09 10:01:20 +02:00
jaubourg
2594a935de Applies exception in Style Guidelines regarding objects and functions when they are the last argument of a function call. 2011-04-08 17:41:14 +02:00
jaubourg
7a1c6beab0 Renames chain as pipe. 2011-04-08 17:35:08 +02:00
jaubourg
bb99899ca0 Adds always and chain methods to deferreds. 2011-04-07 05:49:32 +02:00
jaubourg
f2ce87df8e Fixes #8692. Strange FF4 bug: values changed onto the arguments object sometimes end up as undefined values outside the $.when method. Cloning the object into a fresh array solves the issue. 2011-03-30 18:54:32 +02:00
jaubourg
2d0bc7ce72 Moves Deferred-related code into a separate module. Context handling has been simplified in _Deferred.resolve and jQuery.when has been refactored for clarity (and minor optimization). 2011-03-03 19:38:06 +01:00