8000 refactor(*): move noop functions to `angular.noop` · angular/angular.js@4e30e4a · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4e30e4a

Browse files
ivomjuNarretz
authored andcommitted
refactor(*): move noop functions to angular.noop
Closes #14151
1 parent 181c69b commit 4e30e4a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ng/animate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function prepareAnimateOptions(options) {
5454
}
5555

5656
var $$CoreAnimateJsProvider = function() {
57-
this.$get = function() {};
57+
this.$get = noop;
5858
};
5959

6060
// this is prefixed with Core since it conflicts with

src/ng/compile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
10751075
* See also {@link ng.$compileProvider#directive $compileProvider.directive()}.
10761076
*/
10771077
this.component = function registerComponent(name, options) {
1078-
var controller = options.controller || function() {};
1078+
var controller = options.controller || noop;
10791079

10801080
function factory($injector) {
10811081
function makeInjectable(fn) {

src/ng/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ ASTInterpreter.prototype = {
13141314
forEach(ast.body, function(expression) {
13151315
expressions.push(self.recurse(expression.expression));
13161316
});
1317-
var fn = ast.body.length === 0 ? function() {} :
1317+
var fn = ast.body.length === 0 ? noop :
13181318
ast.body.length === 1 ? expressions[0] :
13191319
function(scope, locals) {
13201320
var lastValue;

0 commit comments

Comments
 (0)
0