Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

Commit

Permalink
Fixed expecting exported global functions in chain/paralle.
Browse files Browse the repository at this point in the history
  • Loading branch information
cho45 committed Jan 7, 2011
1 parent 15d1177 commit e193331
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions jsdeferred.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Deferred.next = Deferred.next_faster_way_readystatechange ||
Deferred.next_default;

Deferred.chain = function () {
var chain = next();
var chain = Deferred.next();
for (var i = 0, len = arguments.length; i < len; i++) (function (obj) {
switch (typeof obj) {
case "function":
Expand All @@ -137,7 +137,7 @@ Deferred.chain = function () {
}
break;
case "object":
chain = chain.next(function() { return parallel(obj) });
chain = chain.next(function() { return Deferred.parallel(obj) });
break;
default:
throw "unknown type in process chains";
Expand Down Expand Up @@ -166,7 +166,7 @@ Deferred.parallel = function (dl) {
if (arguments.length > 1) dl = Array.prototype.slice.call(arguments);
var ret = new Deferred(), values = {}, num = 0;
for (var i in dl) if (dl.hasOwnProperty(i)) (function (d, i) {
if (typeof d == "function") d = next(d);
if (typeof d == "function") d = Deferred.next(d);
d.next(function (v) {
values[i] = v;
if (--num <= 0) {
Expand Down
6 changes: 3 additions & 3 deletions jsdeferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ Deferred.next = Deferred.next_faster_way_readystatechange ||
* @return {Deferred}
*/
Deferred.chain = function () {
var chain = next();
var chain = Deferred.next();
for (var i = 0, len = arguments.length; i < len; i++) (function (obj) {
switch (typeof obj) {
case "function":
Expand All @@ -341,7 +341,7 @@ Deferred.chain = function () {
}
break;
case "object":
chain = chain.next(function() { return parallel(obj) });
chain = chain.next(function() { return Deferred.parallel(obj) });
break;
default:
throw "unknown type in process chains";
Expand Down Expand Up @@ -435,7 +435,7 @@ Deferred.parallel = function (dl) {
if (arguments.length > 1) dl = Array.prototype.slice.call(arguments);
var ret = new Deferred(), values = {}, num = 0;
for (var i in dl) if (dl.hasOwnProperty(i)) (function (d, i) {
if (typeof d == "function") d = next(d);
if (typeof d == "function") d = Deferred.next(d);
d.next(function (v) {
values[i] = v;
if (--num <= 0) {
Expand Down
6 changes: 3 additions & 3 deletions jsdeferred.nodoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Deferred.next = Deferred.next_faster_way_readystatechange ||
Deferred.next_default;

Deferred.chain = function () {
var chain = next();
var chain = Deferred.next();
for (var i = 0, len = arguments.length; i < len; i++) (function (obj) {
switch (typeof obj) {
case "function":
Expand All @@ -137,7 +137,7 @@ Deferred.chain = function () {
}
break;
case "object":
chain = chain.next(function() { return parallel(obj) });
chain = chain.next(function() { return Deferred.parallel(obj) });
break;
default:
throw "unknown type in process chains";
Expand Down Expand Up @@ -166,7 +166,7 @@ Deferred.parallel = function (dl) {
if (arguments.length > 1) dl = Array.prototype.slice.call(arguments);
var ret = new Deferred(), values = {}, num = 0;
for (var i in dl) if (dl.hasOwnProperty(i)) (function (d, i) {
if (typeof d == "function") d = next(d);
if (typeof d == "function") d = Deferred.next(d);
d.next(function (v) {
values[i] = v;
if (--num <= 0) {
Expand Down
6 changes: 3 additions & 3 deletions jsdeferred.userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Deferred.next = Deferred.next_faster_way_readystatechange ||
Deferred.next_default;

Deferred.chain = function () {
var chain = next();
var chain = Deferred.next();
for (var i = 0, len = arguments.length; i < len; i++) (function (obj) {
switch (typeof obj) {
case "function":
Expand All @@ -140,7 +140,7 @@ Deferred.chain = function () {
}
break;
case "object":
chain = chain.next(function() { return parallel(obj) });
chain = chain.next(function() { return Deferred.parallel(obj) });
break;
default:
throw "unknown type in process chains";
Expand Down Expand Up @@ -169,7 +169,7 @@ Deferred.parallel = function (dl) {
if (arguments.length > 1) dl = Array.prototype.slice.call(arguments);
var ret = new Deferred(), values = {}, num = 0;
for (var i in dl) if (dl.hasOwnProperty(i)) (function (d, i) {
if (typeof d == "function") d = next(d);
if (typeof d == "function") d = Deferred.next(d);
d.next(function (v) {
values[i] = v;
if (--num <= 0) {
Expand Down

0 comments on commit e193331

Please sign in to comment.