Expression caching

improved version of #9006 (which was an improved version of #8942)
I think that is nothing new, but now it will only happen when the filter
also has the "externalInput" flag. I think the test was just bad...

For example `$scope.$watch("[0] | filter")` would always cause this because
the output is a literal (recreated each digest) but is not constant because
of the filter.

On 15 September 2014 15:21, Caitlin Potter <notifications@github.com> wrote:

> In test/ng/parseSpec.js:
>
> > +          var watcherCalls = 0;
> > +          scope.$watch(parsed, function(input) {
> > +            expect(input).toEqual({x:1});
> > +            watcherCalls++;
> > +          });
> > +
> > +          scope.$digest();
> > +          expect(filterCalls).toBe(1);
> > +          expect(watcherCalls).toBe(1);
> > +
> > +          scope.$digest();
> > +          expect(filterCalls).toBe(1);
> > +          expect(watcherCalls).toBe(1);
> > +        }));
> > +        it('should not treat constants passed to filters with externalInput as constants', inject(function($parse) {
> > +
>
>  such expression would result in infinite digest though because we'd
> recreate the constant object during each reevaluation.
>
> Actually, that sounds like a problem --- because it sounds like it could
> break peoples code. I might be missing something, but I don't think we want
> to not fix that
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/angular/angular.js/pull/9082/files#r17572834>.
>