Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor(animate/compile/parse): Move all noop functions to noop #14151

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ng/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function prepareAnimateOptions(options) {
}

var $$CoreAnimateJsProvider = function() {
this.$get = function() {};
this.$get = noop;
};

// this is prefixed with Core since it conflicts with
Expand Down
2 changes: 1 addition & 1 deletion src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
* See also {@link ng.$compileProvider#directive $compileProvider.directive()}.
*/
this.component = function registerComponent(name, options) {
var controller = options.controller || function() {};
var controller = options.controller || noop;

function factory($injector) {
function makeInjectable(fn) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ ASTInterpreter.prototype = {
forEach(ast.body, function(expression) {
expressions.push(self.recurse(expression.expression));
});
var fn = ast.body.length === 0 ? function() {} :
var fn = ast.body.length === 0 ? noop :
ast.body.length === 1 ? expressions[0] :
function(scope, locals) {
var lastValue;
Expand Down