Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b77161

Browse files
committed
refactor(Scope): remove useless compileToFn helper fn
1 parent 50e16a6 commit 8b77161

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/ng/rootScope.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ function $RootScopeProvider(){
324324
* @returns {function()} Returns a deregistration function for this listener.
325325
*/
326326
$watch: function(watchExp, listener, objectEquality) {
327-
var get = compileToFn(watchExp, 'watch');
327+
var get = $parse(watchExp);
328328

329329
if (get.$$watchDelegate) {
330330
return get.$$watchDelegate(this, listener, objectEquality, get);
@@ -1206,11 +1206,6 @@ function $RootScopeProvider(){
12061206
$rootScope.$$phase = null;
12071207
}
12081208

1209-
function compileToFn(exp, name) {
1210-
var fn = $parse(exp);
1211-
assertArgFn(fn, name);
1212-
return fn;
1213-
}
12141209

12151210
function decrementListenerCount(current, count, name) {
12161211
do {

0 commit comments

Comments
 (0)