nl_tokens: @ngdoc function @name ng . $rootScope . Scope#$watch @methodOf ng . $rootScope . Scope @function
pl_tokens: function ( watchExp , listener , objectEquality ) { var scope = this , <mask> = compileToFn ( watchExp , 'watch' ) , array = scope . $$watchers , watcher = { fn : listener , last : initWatchVal , get : get , exp : watchExp , eq : ! ! objectEquality } ; // in the case user pass string, we need to compile it, do we really need this ? if ( ! isFunction ( listener ) ) { var listenFn = compileToFn ( listener || noop , 'listener' ) ; watcher . fn = function ( newVal , oldVal , scope ) { listenFn ( scope ) ; } ; } if ( typeof watchExp == 'string' && get . constant ) { var originalFn = watcher . fn ; watcher . fn = function ( newVal , oldVal , scope ) { originalFn . call ( this , newVal , oldVal , scope ) ; arrayRemove ( array , watcher ) ; } ; } if ( ! array ) { array = scope . $$watchers = [ ] ; } // we use unshift since we use a while loop in $digest for speed. // the while loop reads in reverse order. array . unshift ( watcher ) ; return function ( ) { arrayRemove ( array , watcher ) ; } ; }