Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f1b25c4

Browse files
committed
WIP: rename externalInput flag to $stateful
1 parent 6104361 commit f1b25c4

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
17381738
}
17391739
return lastValue = parentValue;
17401740
};
1741-
parentValueWatch.externalInput = true;
1741+
parentValueWatch.$stateful = true;
17421742
var unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);
17431743
isolateScope.$on('$destroy', unwatch);
17441744
break;

src/ng/parse.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ Parser.prototype = {
572572

573573
return fn(input);
574574
}, {
575-
constant: !fn.externalInput && inputs.every(isConstant),
576-
inputs: !fn.externalInput && inputs
575+
constant: !fn.$stateful && inputs.every(isConstant),
576+
inputs: !fn.$stateful && inputs
577577
});
578578
},
579579

@@ -1217,9 +1217,9 @@ function $ParseProvider() {
12171217
if (parsedExpression.$$watchDelegate &&
12181218
parsedExpression.$$watchDelegate !== inputsWatchDelegate) {
12191219
fn.$$watchDelegate = parsedExpression.$$watchDelegate;
1220-
} else if (!interceptorFn.externalInput) {
1220+
} else if (!interceptorFn.$stateful) {
12211221
// If there is an interceptor, but no watchDelegate then treat the interceptor like
1222-
// we treat filters - it is assumed to be a pure function unless flagged with externalInput
1222+
// we treat filters - it is assumed to be a pure function unless flagged with $stateful
12231223
fn.$$watchDelegate = inputsWatchDelegate;
12241224
fn.inputs = [parsedExpression];
12251225
}

src/ng/rootScope.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ function $RootScopeProvider(){
515515
* de-registration function is executed, the internal watch operation is terminated.
516516
*/
517517
$watchCollection: function(obj, listener) {
518-
$watchCollectionInterceptor.externalInput = true;
518+
$watchCollectionInterceptor.$stateful = true;
519519

520520
var self = this;
521521
// the current value, updated on each dirty-check run

test/ng/parseSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1371,12 +1371,12 @@ describe('parser', function() {
13711371
expect(filterCalled).toBe(true);
13721372
});
13731373

1374-
it('should invoke filters if they are marked as having externalInput', function() {
1374+
it('should invoke filters if they are marked as having $stateful', function() {
13751375
var filterCalled = false;
13761376
$filterProvider.register('foo', valueFn(extend(function(input) {
13771377
filterCalled = true;
13781378
return input;
1379-
}, {externalInput: true})));
1379+
}, {$stateful: true})));
13801380

13811381
scope.$watch("a | foo:b:1");
13821382
scope.a = 0;
@@ -1514,13 +1514,13 @@ describe('parser', function() {
15141514
expect(watcherCalls).toBe(1);
15151515
}));
15161516

1517-
it('should invoke interceptorFns if they are flagged as having externalInput',
1517+
it('should invoke interceptorFns if they are flagged as having $stateful',
15181518
inject(function($parse) {
15191519
var called = false;
15201520
function interceptor() {
15211521
called = true;
15221522
}
1523-
interceptor.externalInput = true;
1523+
interceptor.$stateful = true;
15241524

15251525
scope.$watch($parse("a", interceptor));
15261526
scope.a = 0;

0 commit comments

Comments
 (0)