11/**
2- * @license scalyr v1.0.1
2+ * @license scalyr v1.0.2
33 * (c) 2013 Scalyr, Inc. http://scalyr.com
44 * License: MIT
55 */
6+
7+ 'use strict' ;
8+
69// You may just depend on the 'sly' module to pull in all of the
710// dependencies.
811angular . module ( 'sly' , [ 'slyEvaluate' , 'slyRepeat' ] ) ;
@@ -587,8 +590,10 @@ defineScalyrAngularModule('slyRepeat', ['gatedScope'])
587590 // was first 10, then 5, we will end up with the last 5 elements in the previousElementBuffer.
588591 // We keep this in case the length increases again.
589592 var previousElementBuffer = [ ] ;
590-
591- var deregisterCallback = $scope . $watchCollection ( collectionExpr , function ( collection ) {
593+
594+ var deregisterCallback = $scope . $watchCollection ( collectionExpr , function ( collection ) {
595+ if ( ! collection )
596+ return ;
592597 if ( ! isArray ( collection ) )
593598 throw Error ( "'collection' did not evaluate to an array. expression was " + collectionExpr ) ;
594599 var originalPreviousElementsLength = previousElements . length ;
@@ -714,12 +719,12 @@ defineScalyrAngularModule('slyRepeat', ['gatedScope'])
714719defineScalyrAngularModule ( 'gatedScope' , [ ] )
715720. config ( [ '$provide' , function ( $provide ) {
716721 // We use a decorator to override methods in $rootScope.
717- $provide . decorator ( '$rootScope' , [ '$delegate' , '$exceptionHandler' ,
722+ $provide . decorator ( '$rootScope' , [ '$delegate' , '$exceptionHandler' ,
718723 function ( $rootScope , $exceptionHandler ) {
719724
720725 // Make a copy of $rootScope's original methods so that we can access
721726 // them to invoke super methods in the ones we override.
722- scopePrototype = { } ;
727+ var scopePrototype = { } ;
723728 for ( var key in $rootScope ) {
724729 if ( isFunction ( $rootScope [ key ] ) )
725730 scopePrototype [ key ] = $rootScope [ key ] ;
@@ -743,7 +748,7 @@ defineScalyrAngularModule('gatedScope', [])
743748 // Because of how scope.$new works, the returned result
744749 // should already have our new methods.
745750 var result = scopePrototype . $new . call ( this , isolate ) ;
746-
751+
747752 // We just have to do the work that normally a child class's
748753 // constructor would perform -- initializing our instance vars.
749754 result . $$gatingFunction = this . $$gatingFunction ;
@@ -766,7 +771,7 @@ defineScalyrAngularModule('gatedScope', [])
766771 var watch , value ,
767772 watchers ,
768773 length ,
769- next , current = this , target = this ,
774+ next , current = this , target = this , last ,
770775 dirty = false ;
771776
772777 do { // "traverse the scopes" loop
0 commit comments