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

Commit 761876f

Browse files
committed
pr feedback
1 parent 574c4f8 commit 761876f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ng/parse.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ function isStateless($filter, filterName) {
623623
}
624624

625625
// Detect nodes which could depend on non-shallow state of objects
626-
function isPure(node, parentPureness) {
626+
function isPure(node, parentIsPure) {
627627
switch (node.type) {
628628
// Computed members might invoke a stateful toString()
629629
case AST.MemberExpression:
@@ -632,6 +632,7 @@ function isPure(node, parentPureness) {
632632
}
633633
break;
634634

635+
// Unary always convert to primative
635636
case AST.UnaryExpression:
636637
return true;
637638

@@ -644,15 +645,15 @@ function isPure(node, parentPureness) {
644645
return false;
645646
}
646647

647-
return parentPureness;
648+
return (undefined === parentIsPure) || parentIsPure;
648649
}
649650

650651
function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
651652
var allConstants;
652653
var argsToWatch;
653654
var isStatelessFilter;
654655

655-
ast.isPure = parentIsPure = isPure(ast, (undefined === parentIsPure) || parentIsPure);
656+
ast.isPure = parentIsPure = isPure(ast, parentIsPure);
656657

657658
switch (ast.type) {
658659
case AST.Program:

0 commit comments

Comments
 (0)