File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,20 @@ angular.module('a8m.filter-watcher', [])
4141 * @returns {string }
4242 */
4343 function getHashKey ( fName , args ) {
44- return [ fName , angular . toJson ( args ) ]
44+ function replacerFactory ( ) {
45+ var cache = [ ] ;
46+ return function ( key , val ) {
47+ if ( isObject ( val ) && ! isNull ( val ) ) {
48+ if ( ~ cache . indexOf ( val ) ) return '[Circular]' ;
49+ cache . push ( val )
50+ }
51+ if ( $window == val ) return '$WINDOW' ;
52+ if ( $window . document == val ) return '$DOCUMENT' ;
53+ if ( isScope ( val ) ) return '$SCOPE' ;
54+ return val ;
55+ }
56+ }
57+ return [ fName , JSON . stringify ( args , replacerFactory ( ) ) ]
4558 . join ( '#' )
4659 . replace ( / " / g, '' ) ;
4760 }
@@ -130,7 +143,6 @@ angular.module('a8m.filter-watcher', [])
130143 isMemoized : $$isMemoized ,
131144 memoize : $$memoize
132145 }
133-
134146 } ] ;
135147 } ) ;
136148
You can’t perform that action at this time.
0 commit comments