Skip to content

Commit b41c594

Browse files
christopherthielenmergify[bot]
authored andcommitted
chore: update local copies of angularjs lib v1.6
1 parent 93523fa commit b41c594

File tree

3 files changed

+1245
-594
lines changed

3 files changed

+1245
-594
lines changed

test/angular/1.6/angular-animate.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @license AngularJS v1.6.8
3-
* (c) 2010-2017 Google, Inc. http://angularjs.org
2+
* @license AngularJS v1.6.10
3+
* (c) 2010-2018 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
66
(function(window, angular) {'use strict';
@@ -532,7 +532,7 @@ var ANIMATE_TIMER_KEY = '$$animateCss';
532532
* Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that
533533
* is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,
534534
* any automatic control over cancelling animations and/or preventing animations from being run on
535-
* child elements will not be handled by Angular. For this to work as expected, please use `$animate` to
535+
* child elements will not be handled by AngularJS. For this to work as expected, please use `$animate` to
536536
* trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger
537537
* the CSS animation.
538538
*
@@ -2774,7 +2774,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
27742774

27752775
while (parentNode) {
27762776
if (!rootNodeDetected) {
2777-
// angular doesn't want to attempt to animate elements outside of the application
2777+
// AngularJS doesn't want to attempt to animate elements outside of the application
27782778
// therefore we need to ensure that the rootElement is an ancestor of the current element
27792779
rootNodeDetected = (parentNode === rootNode);
27802780
}
@@ -3387,7 +3387,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
33873387
* @description
33883388
*
33893389
* The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via
3390-
* callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app.
3390+
* callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an AngularJS app.
33913391
*
33923392
* ## Usage
33933393
* Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based
@@ -3416,7 +3416,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
34163416
* ## CSS-based Animations
34173417
*
34183418
* CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML
3419-
* and CSS code we can create an animation that will be picked up by Angular when an underlying directive performs an operation.
3419+
* and CSS code we can create an animation that will be picked up by AngularJS when an underlying directive performs an operation.
34203420
*
34213421
* The example below shows how an `enter` animation can be made possible on an element using `ng-if`:
34223422
*
@@ -3675,7 +3675,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
36753675
* enter: function(element, doneFn) {
36763676
* jQuery(element).fadeIn(1000, doneFn);
36773677
*
3678-
* // remember to call doneFn so that angular
3678+
* // remember to call doneFn so that AngularJS
36793679
* // knows that the animation has concluded
36803680
* },
36813681
*
@@ -3723,7 +3723,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
37233723
*
37243724
* ## CSS + JS Animations Together
37253725
*
3726-
* AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular,
3726+
* AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of AngularJS,
37273727
* defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking
37283728
* charge of the animation**:
37293729
*
@@ -4039,7 +4039,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
40394039
*
40404040
* ## Using $animate in your directive code
40414041
*
4042-
* So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application?
4042+
* So far we've explored how to feed in animations into an AngularJS application, but how do we trigger animations within our own directives in our application?
40434043
* By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's
40444044
* imagine we have a greeting box that shows and hides itself when the data changes
40454045
*
@@ -4082,7 +4082,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
40824082
* });
40834083
* ```
40844084
*
4085-
* (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case
4085+
* (Note that earlier versions of AngularJS prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case
40864086
* anymore.)
40874087
*
40884088
* In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering
@@ -4097,7 +4097,7 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
40974097
* }])
40984098
* ```
40994099
*
4100-
* (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.)
4100+
* (Note that you will need to trigger a digest within the callback to get AngularJS to notice any scope-related changes.)
41014101
*/
41024102

41034103
var copy;
@@ -4124,7 +4124,7 @@ var noop;
41244124
* Click here {@link ng.$animate to learn more about animations with `$animate`}.
41254125
*/
41264126
angular.module('ngAnimate', [], function initAngularHelpers() {
4127-
// Access helpers from angular core.
4127+
// Access helpers from AngularJS core.
41284128
// Do it inside a `config` block to ensure `window.angular` is available.
41294129
noop = angular.noop;
41304130
copy = angular.copy;
@@ -4139,7 +4139,7 @@ angular.module('ngAnimate', [], function initAngularHelpers() {
41394139
isFunction = angular.isFunction;
41404140
isElement = angular.isElement;
41414141
})
4142-
.info({ angularVersion: '1.6.8' })
4142+
.info({ angularVersion: '1.6.10' })
41434143
.directive('ngAnimateSwap', ngAnimateSwapDirective)
41444144

41454145
.directive('ngAnimateChildren', $$AnimateChildrenDirective)

test/angular/1.6/angular-mocks.js

+40-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @license AngularJS v1.6.8
3-
* (c) 2010-2017 Google, Inc. http://angularjs.org
2+
* @license AngularJS v1.6.10
3+
* (c) 2010-2018 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
66
(function(window, angular) {
@@ -803,7 +803,7 @@ angular.mock.TzDate.prototype = Date.prototype;
803803
* You need to require the `ngAnimateMock` module in your test suite for instance `beforeEach(module('ngAnimateMock'))`
804804
*/
805805
angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
806-
.info({ angularVersion: '1.6.8' })
806+
.info({ angularVersion: '1.6.10' })
807807

808808
.config(['$provide', function($provide) {
809809

@@ -969,7 +969,7 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
969969
*
970970
* *NOTE*: This is not an injectable instance, just a globally available function.
971971
*
972-
* Method for serializing common angular objects (scope, elements, etc..) into strings.
972+
* Method for serializing common AngularJS objects (scope, elements, etc..) into strings.
973973
* It is useful for logging objects to the console when debugging.
974974
*
975975
* @param {*} object - any object to turn into string.
@@ -1051,7 +1051,7 @@ angular.mock.dump = function(object) {
10511051
* This mock implementation can be used to respond with static or dynamic responses via the
10521052
* `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc).
10531053
*
1054-
* When an Angular application needs some data from a server, it calls the $http service, which
1054+
* When an AngularJS application needs some data from a server, it calls the $http service, which
10551055
* sends the request to a real server using $httpBackend service. With dependency injection, it is
10561056
* easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify
10571057
* the requests and respond with some testing data without sending a request to a real server.
@@ -1385,9 +1385,13 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
13851385
function wrapResponse(wrapped) {
13861386
if (!$browser && timeout) {
13871387
if (timeout.then) {
1388-
timeout.then(handleTimeout);
1388+
timeout.then(function() {
1389+
handlePrematureEnd(angular.isDefined(timeout.$$timeoutId) ? 'timeout' : 'abort');
1390+
});
13891391
} else {
1390-
$timeout(handleTimeout, timeout);
1392+
$timeout(function() {
1393+
handlePrematureEnd('timeout');
1394+
}, timeout);
13911395
}
13921396
}
13931397

@@ -1401,11 +1405,11 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
14011405
copy(response[3] || ''), copy(response[4]));
14021406
}
14031407

1404-
function handleTimeout() {
1408+
function handlePrematureEnd(reason) {
14051409
for (var i = 0, ii = responses.length; i < ii; i++) {
14061410
if (responses[i] === handleResponse) {
14071411
responses.splice(i, 1);
1408-
callback(-1, undefined, '', undefined, 'timeout');
1412+
callback(-1, undefined, '', undefined, reason);
14091413
break;
14101414
}
14111415
}
@@ -2117,10 +2121,14 @@ function MockXhr() {
21172121
return lines.join('\n');
21182122
};
21192123

2120-
this.abort = angular.noop;
2124+
this.abort = function() {
2125+
if (isFunction(this.onabort)) {
2126+
this.onabort();
2127+
}
2128+
};
21212129

21222130
// This section simulates the events on a real XHR object (and the upload object)
2123-
// When we are testing $httpBackend (inside the angular project) we make partial use of this
2131+
// When we are testing $httpBackend (inside the AngularJS project) we make partial use of this
21242132
// but store the events directly ourselves on `$$events`, instead of going through the `addEventListener`
21252133
this.$$events = {};
21262134
this.addEventListener = function(name, listener) {
@@ -2426,7 +2434,7 @@ angular.module('ngMock', ['ng']).provider({
24262434
$provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);
24272435
$provide.decorator('$controller', createControllerDecorator($compileProvider));
24282436
$provide.decorator('$httpBackend', angular.mock.$httpBackendDecorator);
2429-
}]).info({ angularVersion: '1.6.8' });
2437+
}]).info({ angularVersion: '1.6.10' });
24302438

24312439
/**
24322440
* @ngdoc module
@@ -2435,13 +2443,13 @@ angular.module('ngMock', ['ng']).provider({
24352443
* @packageName angular-mocks
24362444
* @description
24372445
*
2438-
* The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing.
2446+
* The `ngMockE2E` is an AngularJS module which contains mocks suitable for end-to-end testing.
24392447
* Currently there is only one mock present in this module -
24402448
* the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.
24412449
*/
24422450
angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
24432451
$provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
2444-
}]).info({ angularVersion: '1.6.8' });
2452+
}]).info({ angularVersion: '1.6.10' });
24452453

24462454
/**
24472455
* @ngdoc service
@@ -3353,6 +3361,24 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
33533361
evnt.keyCode = eventData.keyCode;
33543362
evnt.charCode = eventData.charCode;
33553363
evnt.which = eventData.which;
3364+
} else if (/composition/.test(eventType)) {
3365+
try {
3366+
evnt = new window.CompositionEvent(eventType, {
3367+
data: eventData.data
3368+
});
3369+
} catch (e) {
3370+
// Support: IE9+
3371+
evnt = window.document.createEvent('CompositionEvent', {});
3372+
evnt.initCompositionEvent(
3373+
eventType,
3374+
eventData.bubbles,
3375+
eventData.cancelable,
3376+
window,
3377+
eventData.data,
3378+
null
3379+
);
3380+
}
3381+
33563382
} else {
33573383
evnt = window.document.createEvent('MouseEvents');
33583384
x = x || 0;

0 commit comments

Comments
 (0)