New URL in $rootScope.$watch in $LocationProvider #10515
Description
Looking at the latest version (AngularJS v1.3.7), I came across this in the $LocationProvider -> $rootScope.$watch function $locationWatch.
Under $rootScope.$watch, newUrl = trimEmptyHash($location.absUrl()), but under the $rootScope.$evalAsync function, newUrl (a new variable) = $location.absUrl().
Maybe this is the way it is suppose to be, but it does make one wonder if you are comparing apples to oranges later in the $rootScope.$evalAsync function. I'm still learning AngularJS and there is a lot going on here with the $rootScope.$broadcast stuff going on just before the newUrl variable is compared again, so unfortunately I can't help give a definitive answer. But it might be better to rename the inner function scope variable something slightly different, so it won't be confused for the outer scope one in the future. At least that would make it more evident that this is the correct structure.