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

Commit adf5752

Browse files
committed
refactor($rootScope): items in asyncQueue are already $parsed, no need to call $eval
1 parent 493b496 commit adf5752

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ng/rootScope.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,12 +786,13 @@ function $RootScopeProvider() {
786786
current = target;
787787

788788
// It's safe for asyncQueuePosition to be a local variable here because this loop can't
789-
// be reentered recursively. Calling $digest from a function passed to $applyAsync would
789+
// be reentered recursively. Calling $digest from a function passed to $evalAsync would
790790
// lead to a '$digest already in progress' error.
791791
for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) {
792792
try {
793793
asyncTask = asyncQueue[asyncQueuePosition];
794-
asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);
794+
fn = asyncTask.fn;
795+
fn(asyncTask.scope, asyncTask.locals);
795796
} catch (e) {
796797
$exceptionHandler(e);
797798
}
@@ -1025,7 +1026,7 @@ function $RootScopeProvider() {
10251026
});
10261027
}
10271028

1028-
asyncQueue.push({scope: this, expression: $parse(expr), locals: locals});
1029+
asyncQueue.push({scope: this, fn: $parse(expr), locals: locals});
10291030
},
10301031

10311032
$$postDigest: function(fn) {

0 commit comments

Comments
 (0)