summaryrefslogtreecommitdiffstats
path: root/js/vendor/angular-mocks/angular-mocks.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/vendor/angular-mocks/angular-mocks.js')
-rw-r--r--js/vendor/angular-mocks/angular-mocks.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/js/vendor/angular-mocks/angular-mocks.js b/js/vendor/angular-mocks/angular-mocks.js
index 25b86539f..84b695274 100644
--- a/js/vendor/angular-mocks/angular-mocks.js
+++ b/js/vendor/angular-mocks/angular-mocks.js
@@ -1,5 +1,5 @@
/**
- * @license AngularJS v1.3.2
+ * @license AngularJS v1.3.3
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@@ -117,7 +117,7 @@ angular.mock.$Browser = function() {
self.defer.now += delay;
} else {
if (self.deferredFns.length) {
- self.defer.now = self.deferredFns[self.deferredFns.length-1].time;
+ self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;
} else {
throw new Error('No deferred tasks to be flushed');
}
@@ -428,7 +428,7 @@ angular.mock.$LogProvider = function() {
});
});
if (errors.length) {
- errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or "+
+ errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
"an expected log message was not checked and removed:");
errors.push('');
throw new Error(errors.join('\n---------\n'));
@@ -461,17 +461,17 @@ angular.mock.$LogProvider = function() {
* @returns {promise} A promise which will be notified on each iteration.
*/
angular.mock.$IntervalProvider = function() {
- this.$get = ['$rootScope', '$q',
- function($rootScope, $q) {
+ this.$get = ['$browser', '$rootScope', '$q', '$$q',
+ function($browser, $rootScope, $q, $$q) {
var repeatFns = [],
nextRepeatId = 0,
now = 0;
var $interval = function(fn, delay, count, invokeApply) {
- var deferred = $q.defer(),
- promise = deferred.promise,
- iteration = 0,
- skipApply = (angular.isDefined(invokeApply) && !invokeApply);
+ var iteration = 0,
+ skipApply = (angular.isDefined(invokeApply) && !invokeApply),
+ deferred = (skipApply ? $$q : $q).defer(),
+ promise = deferred.promise;
count = (angular.isDefined(count)) ? count : 0;
promise.then(null, null, fn);
@@ -494,7 +494,11 @@ angular.mock.$IntervalProvider = function() {
}
}
- if (!skipApply) $rootScope.$apply();
+ if (skipApply) {
+ $browser.defer.flush();
+ } else {
+ $rootScope.$apply();
+ }
}
repeatFns.push({
@@ -581,10 +585,10 @@ function jsonStringToDate(string) {
tzMin = int(match[9] + match[11]);
}
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
- date.setUTCHours(int(match[4]||0) - tzHour,
- int(match[5]||0) - tzMin,
- int(match[6]||0),
- int(match[7]||0));
+ date.setUTCHours(int(match[4] || 0) - tzHour,
+ int(match[5] || 0) - tzMin,
+ int(match[6] || 0),
+ int(match[7] || 0));
return date;
}
return string;
@@ -663,7 +667,7 @@ angular.mock.TzDate = function(offset, timestamp) {
}
var localOffset = new Date(timestamp).getTimezoneOffset();
- self.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
+ self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;
self.date = new Date(timestamp + self.offsetDiff);
self.getTime = function() {
@@ -815,7 +819,7 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
animate.queue.push({
event: method,
element: arguments[0],
- options: arguments[arguments.length-1],
+ options: arguments[arguments.length - 1],
args: arguments
});
return $delegate[method].apply($delegate, arguments);
@@ -1770,7 +1774,7 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
}
var length = queue.length;
- for (var i=0;i<length;i++) {
+ for (var i = 0; i < length; i++) {
queue[i]();
}