Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 10cd279

Browse files
author
Tankred Hase
committed
Upgrade to angular.js 1.3.13
1 parent 9c6d618 commit 10cd279

File tree

4 files changed

+3594
-3493
lines changed

4 files changed

+3594
-3493
lines changed

src/lib/angular/angular-animate.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.7
2+
* @license AngularJS v1.3.13
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -839,7 +839,8 @@ angular.module('ngAnimate', ['ng'])
839839
* promise that was returned when the animation was started.
840840
*
841841
* ```js
842-
* var promise = $animate.addClass(element, 'super-long-animation').then(function() {
842+
* var promise = $animate.addClass(element, 'super-long-animation');
843+
* promise.then(function() {
843844
* //this will still be called even if cancelled
844845
* });
845846
*
@@ -1332,8 +1333,7 @@ angular.module('ngAnimate', ['ng'])
13321333
} else if (lastAnimation.event == 'setClass') {
13331334
animationsToCancel.push(lastAnimation);
13341335
cleanup(element, className);
1335-
}
1336-
else if (runningAnimations[className]) {
1336+
} else if (runningAnimations[className]) {
13371337
var current = runningAnimations[className];
13381338
if (current.event == animationEvent) {
13391339
skipAnimation = true;
@@ -1874,7 +1874,7 @@ angular.module('ngAnimate', ['ng'])
18741874
return;
18751875
}
18761876

1877-
if (!staggerTime && styles) {
1877+
if (!staggerTime && styles && Object.keys(styles).length > 0) {
18781878
if (!timings.transitionDuration) {
18791879
element.css('transition', timings.animationDuration + 's linear all');
18801880
appliedStyles.push('transition');

src/lib/angular/angular-mocks.js

+38-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.7
2+
* @license AngularJS v1.3.13
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -250,31 +250,31 @@ angular.mock.$ExceptionHandlerProvider = function() {
250250
*
251251
* @param {string} mode Mode of operation, defaults to `rethrow`.
252252
*
253-
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
254-
* is a bug in the application or test, so this mock will make these tests fail.
255253
* - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
256254
* mode stores an array of errors in `$exceptionHandler.errors`, to allow later
257255
* assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
258256
* {@link ngMock.$log#reset reset()}
257+
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
258+
* is a bug in the application or test, so this mock will make these tests fail.
259+
* For any implementations that expect exceptions to be thrown, the `rethrow` mode
260+
* will also maintain a log of thrown errors.
259261
*/
260262
this.mode = function(mode) {
263+
261264
switch (mode) {
262-
case 'rethrow':
263-
handler = function(e) {
264-
throw e;
265-
};
266-
break;
267265
case 'log':
266+
case 'rethrow':
268267
var errors = [];
269-
270268
handler = function(e) {
271269
if (arguments.length == 1) {
272270
errors.push(e);
273271
} else {
274272
errors.push([].slice.call(arguments, 0));
275273
}
274+
if (mode === "rethrow") {
275+
throw e;
276+
}
276277
};
277-
278278
handler.errors = errors;
279279
break;
280280
default:
@@ -1283,7 +1283,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
12831283
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
12841284
* and returns true if the url match the current definition.
12851285
* @param {(Object|function(Object))=} headers HTTP headers.
1286-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1286+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
12871287
* request is handled. You can save this object for later use and invoke `respond` again in
12881288
* order to change how a matched request is handled.
12891289
*/
@@ -1297,7 +1297,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
12971297
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
12981298
* and returns true if the url match the current definition.
12991299
* @param {(Object|function(Object))=} headers HTTP headers.
1300-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1300+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
13011301
* request is handled. You can save this object for later use and invoke `respond` again in
13021302
* order to change how a matched request is handled.
13031303
*/
@@ -1311,7 +1311,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
13111311
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
13121312
* and returns true if the url match the current definition.
13131313
* @param {(Object|function(Object))=} headers HTTP headers.
1314-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1314+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
13151315
* request is handled. You can save this object for later use and invoke `respond` again in
13161316
* order to change how a matched request is handled.
13171317
*/
@@ -1327,7 +1327,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
13271327
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
13281328
* data string and returns true if the data is as expected.
13291329
* @param {(Object|function(Object))=} headers HTTP headers.
1330-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1330+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
13311331
* request is handled. You can save this object for later use and invoke `respond` again in
13321332
* order to change how a matched request is handled.
13331333
*/
@@ -1343,7 +1343,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
13431343
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
13441344
* data string and returns true if the data is as expected.
13451345
* @param {(Object|function(Object))=} headers HTTP headers.
1346-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1346+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
13471347
* request is handled. You can save this object for later use and invoke `respond` again in
13481348
* order to change how a matched request is handled.
13491349
*/
@@ -1356,7 +1356,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
13561356
*
13571357
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
13581358
* and returns true if the url match the current definition.
1359-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1359+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
13601360
* request is handled. You can save this object for later use and invoke `respond` again in
13611361
* order to change how a matched request is handled.
13621362
*/
@@ -1377,7 +1377,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
13771377
* is in JSON format.
13781378
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
13791379
* object and returns true if the headers match the current expectation.
1380-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1380+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
13811381
* request is handled. You can save this object for later use and invoke `respond` again in
13821382
* order to change how a matched request is handled.
13831383
*
@@ -1412,7 +1412,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14121412
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
14131413
* and returns true if the url match the current definition.
14141414
* @param {Object=} headers HTTP headers.
1415-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1415+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
14161416
* request is handled. You can save this object for later use and invoke `respond` again in
14171417
* order to change how a matched request is handled. See #expect for more info.
14181418
*/
@@ -1426,7 +1426,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14261426
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
14271427
* and returns true if the url match the current definition.
14281428
* @param {Object=} headers HTTP headers.
1429-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1429+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
14301430
* request is handled. You can save this object for later use and invoke `respond` again in
14311431
* order to change how a matched request is handled.
14321432
*/
@@ -1440,7 +1440,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14401440
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
14411441
* and returns true if the url match the current definition.
14421442
* @param {Object=} headers HTTP headers.
1443-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1443+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
14441444
* request is handled. You can save this object for later use and invoke `respond` again in
14451445
* order to change how a matched request is handled.
14461446
*/
@@ -1457,7 +1457,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14571457
* receives data string and returns true if the data is as expected, or Object if request body
14581458
* is in JSON format.
14591459
* @param {Object=} headers HTTP headers.
1460-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1460+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
14611461
* request is handled. You can save this object for later use and invoke `respond` again in
14621462
* order to change how a matched request is handled.
14631463
*/
@@ -1474,7 +1474,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14741474
* receives data string and returns true if the data is as expected, or Object if request body
14751475
* is in JSON format.
14761476
* @param {Object=} headers HTTP headers.
1477-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1477+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
14781478
* request is handled. You can save this object for later use and invoke `respond` again in
14791479
* order to change how a matched request is handled.
14801480
*/
@@ -1491,7 +1491,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14911491
* receives data string and returns true if the data is as expected, or Object if request body
14921492
* is in JSON format.
14931493
* @param {Object=} headers HTTP headers.
1494-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1494+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
14951495
* request is handled. You can save this object for later use and invoke `respond` again in
14961496
* order to change how a matched request is handled.
14971497
*/
@@ -1504,7 +1504,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
15041504
*
15051505
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
15061506
* and returns true if the url match the current definition.
1507-
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
1507+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
15081508
* request is handled. You can save this object for later use and invoke `respond` again in
15091509
* order to change how a matched request is handled.
15101510
*/
@@ -2134,18 +2134,32 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
21342134
if (window.jasmine || window.mocha) {
21352135

21362136
var currentSpec = null,
2137+
annotatedFunctions = [],
21372138
isSpecRunning = function() {
21382139
return !!currentSpec;
21392140
};
21402141

2142+
angular.mock.$$annotate = angular.injector.$$annotate;
2143+
angular.injector.$$annotate = function(fn) {
2144+
if (typeof fn === 'function' && !fn.$inject) {
2145+
annotatedFunctions.push(fn);
2146+
}
2147+
return angular.mock.$$annotate.apply(this, arguments);
2148+
};
2149+
21412150

21422151
(window.beforeEach || window.setup)(function() {
2152+
annotatedFunctions = [];
21432153
currentSpec = this;
21442154
});
21452155

21462156
(window.afterEach || window.teardown)(function() {
21472157
var injector = currentSpec.$injector;
21482158

2159+
annotatedFunctions.forEach(function(fn) {
2160+
delete fn.$inject;
2161+
});
2162+
21492163
angular.forEach(currentSpec.$modules, function(module) {
21502164
if (module && module.$$hashKey) {
21512165
module.$$hashKey = undefined;

src/lib/angular/angular-route.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.7
2+
* @license AngularJS v1.3.13
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -482,21 +482,15 @@ function $RouteProvider() {
482482
* definitions will be interpolated into the location's path, while
483483
* remaining properties will be treated as query params.
484484
*
485-
* @param {Object} newParams mapping of URL parameter names to values
485+
* @param {!Object<string, string>} newParams mapping of URL parameter names to values
486486
*/
487487
updateParams: function(newParams) {
488488
if (this.current && this.current.$$route) {
489-
var searchParams = {}, self=this;
490-
491-
angular.forEach(Object.keys(newParams), function(key) {
492-
if (!self.current.pathParams[key]) searchParams[key] = newParams[key];
493-
});
494-
495489
newParams = angular.extend({}, this.current.params, newParams);
496490
$location.path(interpolate(this.current.$$route.originalPath, newParams));
497-
$location.search(angular.extend({}, $location.search(), searchParams));
498-
}
499-
else {
491+
// interpolate modifies newParams, only query params are left
492+
$location.search(newParams);
493+
} else {
500494
throw $routeMinErr('norout', 'Tried updating route when with no current route');
501495
}
502496
}

0 commit comments

Comments
 (0)