angular/angular.js — pull request #3711 by spamdaemon (2013-08-23 00:44:42+00:00)
Title: fix: replace x.indexOf(y)==0 with x.lastIndexOf(y,0)===0

Replace the pattern x.indexOf(y)===0 with x.lastIndexOf(y,0) since that
does not have to check the entire string x for that substring.
This fix was triggered when found a test like this x.substr(0,2)=='$$'.

I ran all the unit tests and e2e tests, but did not add any new tests. I was thinking of creating an angular.startsWith function and can do so if desired, but ultimately the number of such prefix tests is rather small so that I decided against it.

I found this little nugget at stack-overflow: http://stackoverflow.com/questions/646628/javascript-startswith