code: function callWaitAllCallbacks() {
      for (var i = 0; i < waitAllCallbacks.length; i++) {
          waitAllCallbacks[0]();
      }
      waitAllCallbacks.splice(0, waitAllCallbacks.splice.length);
      clearInterval(intervalId);
      intervalId = null;
  }
docs: /*
  Internal function.