Skip to content

Commit 435ff7b

Browse files
wesleychonetman92
authored andcommitted
chore(animate): remove dead code
- Remove unused `$$asyncCallback` Fixes angular#12251 Closes angular#12254
1 parent 8c148b8 commit 435ff7b

File tree

3 files changed

+2
-53
lines changed

3 files changed

+2
-53
lines changed

src/AngularPublic.js

-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
$$TestabilityProvider,
8888
$TimeoutProvider,
8989
$$RAFProvider,
90-
$$AsyncCallbackProvider,
9190
$WindowProvider,
9291
$$jqLiteProvider,
9392
$$CookieReaderProvider
@@ -248,7 +247,6 @@ function publishExternalAPI(angular) {
248247
$timeout: $TimeoutProvider,
249248
$window: $WindowProvider,
250249
$$rAF: $$RAFProvider,
251-
$$asyncCallback: $$AsyncCallbackProvider,
252250
$$jqLite: $$jqLiteProvider,
253251
$$HashMap: $$HashMapProvider,
254252
$$cookieReader: $$CookieReaderProvider

src/ngMock/angular-mocks.js

+2-18
Original file line numberDiff line numberDiff line change
@@ -764,15 +764,14 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
764764
};
765765
});
766766

767-
$provide.decorator('$animate', ['$delegate', '$$asyncCallback', '$timeout', '$browser', '$$rAF',
768-
function($delegate, $$asyncCallback, $timeout, $browser, $$rAF) {
767+
$provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF',
768+
function($delegate, $timeout, $browser, $$rAF) {
769769
var animate = {
770770
queue: [],
771771
cancel: $delegate.cancel,
772772
enabled: $delegate.enabled,
773773
triggerCallbackEvents: function() {
774774
$$rAF.flush();
775-
$$asyncCallback.flush();
776775
},
777776
triggerCallbackPromise: function() {
778777
$timeout.flush(0);
@@ -1764,20 +1763,6 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
17641763
return rafFn;
17651764
}];
17661765

1767-
angular.mock.$AsyncCallbackDecorator = ['$delegate', function($delegate) {
1768-
var callbacks = [];
1769-
var addFn = function(fn) {
1770-
callbacks.push(fn);
1771-
};
1772-
addFn.flush = function() {
1773-
angular.forEach(callbacks, function(fn) {
1774-
fn();
1775-
});
1776-
callbacks = [];
1777-
};
1778-
return addFn;
1779-
}];
1780-
17811766
/**
17821767
*
17831768
*/
@@ -1884,7 +1869,6 @@ angular.module('ngMock', ['ng']).provider({
18841869
}).config(['$provide', function($provide) {
18851870
$provide.decorator('$timeout', angular.mock.$TimeoutDecorator);
18861871
$provide.decorator('$$rAF', angular.mock.$RAFDecorator);
1887-
$provide.decorator('$$asyncCallback', angular.mock.$AsyncCallbackDecorator);
18881872
$provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);
18891873
$provide.decorator('$controller', angular.mock.$ControllerDecorator);
18901874
}]);

test/ng/asyncCallbackSpec.js

-33
This file was deleted.

0 commit comments

Comments
 (0)