Permalink
Browse files

little fix for deferred return

  • Loading branch information...
1 parent c660e93 commit 445b0c82c019161d1ec4d471b755a9291f131e35 @jamuhl jamuhl committed Feb 13, 2013
View
@@ -565,7 +565,7 @@
resStore = o.resStore;
if (cb) cb(translate);
if (deferred) deferred.resolve();
- return deferred;
+ if (deferred) return deferred.promise();
}
// languages to load
@@ -588,7 +588,7 @@
if (deferred) deferred.resolve();
});
- return deferred.promise();
+ if (deferred) return deferred.promise();
}
function preload(lngs, cb) {
if (typeof lngs === 'string') lngs = [lngs];

Large diffs are not rendered by default.

Oops, something went wrong.
View
Binary file not shown.
@@ -561,7 +561,7 @@
resStore = o.resStore;
if (cb) cb(translate);
if (deferred) deferred.resolve();
- return deferred;
+ if (deferred) return deferred.promise();
}
// languages to load
@@ -584,7 +584,7 @@
if (deferred) deferred.resolve();
});
- return deferred.promise();
+ if (deferred) return deferred.promise();
}
function preload(lngs, cb) {
if (typeof lngs === 'string') lngs = [lngs];
Binary file not shown.
@@ -562,7 +562,7 @@
resStore = o.resStore;
if (cb) cb(translate);
if (deferred) deferred.resolve();
- return deferred;
+ if (deferred) return deferred.promise();
}
// languages to load
@@ -585,7 +585,7 @@
if (deferred) deferred.resolve();
});
- return deferred.promise();
+ if (deferred) return deferred.promise();
}
function preload(lngs, cb) {
if (typeof lngs === 'string') lngs = [lngs];
View
@@ -47,7 +47,7 @@ function init(options, cb) {
resStore = o.resStore;
if (cb) cb(translate);
if (deferred) deferred.resolve();
- return deferred;
+ if (deferred) return deferred.promise();
}
// languages to load
@@ -70,5 +70,5 @@ function init(options, cb) {
if (deferred) deferred.resolve();
});
- return deferred.promise();
+ if (deferred) return deferred.promise();
}

0 comments on commit 445b0c8

Please sign in to comment.