fix($parse): do not pass scope/locals to interceptors of one-time bindings

This commit is contained in:
Jason Bedard
2017-07-19 22:38:10 -07:00
parent e6d5fe7dea
commit 87a586eb9a
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -1907,7 +1907,7 @@ function $ParseProvider() {
if (isDone(lastValue)) {
scope.$$postDigest(unwatchIfDone);
}
return post(lastValue, scope, locals);
return post(lastValue);
}
}
+14
View File
@@ -3246,6 +3246,20 @@ describe('parser', function() {
expect(args).toEqual([1]);
}));
it('should only be passed the intercepted value when wrapping one-time', inject(function($parse) {
var args;
function interceptor(v) {
args = sliceArgs(arguments);
return v;
}
scope.$watch($parse('::a', interceptor));
scope.a = 1;
scope.$digest();
expect(args).toEqual([1]);
}));
it('should only be passed the intercepted value when double-intercepted',
inject(function($parse) {
var args1;