From 7eae29e5ab478ccb7e02fee8311f8b99ea1d165d Mon Sep 17 00:00:00 2001 From: Lucas Galfaso Date: Mon, 18 Aug 2014 12:04:31 +0100 Subject: [PATCH] perf($rootScope): do not use `Function::call` when not needed When a `$watchGroup` delegates the call to a `$watch`, there is no need to keep the context of `this` --- src/ng/rootScope.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index 6636df2b..9938240a 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -407,7 +407,7 @@ function $RootScopeProvider(){ return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { newValues[0] = value; oldValues[0] = oldValue; - listener.call(this, newValues, (value === oldValue) ? newValues : oldValues, scope); + listener(newValues, (value === oldValue) ? newValues : oldValues, scope); }); }