Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

shouldCall now also handles empty argument #2

Open
wants to merge 1 commit into from

1 participant

Yanis Benson
Yanis Benson

Which allows us to not write redundant functions when we don't need to check results(for example when there is no results at all).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 7, 2013
  1. Yanis Benson
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 6 deletions.
  1. +8 −6 cupoftea.js
14 cupoftea.js
View
@@ -165,12 +165,14 @@ var Callbacks = function (runStack) {
var oldRunStack = currentRunStack;
currentRunStack = runStack;
outstandingCallbacks.remove(callbackId);
- try {
- var result = f.apply(this, arguments);
- } catch (e) {
- results(e);
- expectedExceptions.push(e);
- throw e;
+ if(f){
+ try {
+ var result = f.apply(this, arguments);
+ } catch (e) {
+ results(e);
+ expectedExceptions.push(e);
+ throw e;
+ }
}
if (outstandingCallbacks.isEmpty()) {
Something went wrong with that request. Please try again.