diff --git a/src/com/google/javascript/jscomp/NodeUtil.java b/src/com/google/javascript/jscomp/NodeUtil.java index 85f906951c5..06a2144aaa3 100644 --- a/src/com/google/javascript/jscomp/NodeUtil.java +++ b/src/com/google/javascript/jscomp/NodeUtil.java @@ -5001,65 +5001,54 @@ static Node newCallNode(Node callTarget, Node... parameters) { } /** - * @return Whether the result of the expression node is known to be a primitive value - * or an object that has not yet escaped. - */ - static boolean evaluatesToLocalValue(Node value) { - return evaluatesToLocalValue(value, Predicates.alwaysFalse()); - } - - /** - * @param locals A predicate to apply to unknown local values. - * @return Whether the result of the expression node is known to be a primitive value - * or an object that has not yet escaped. This guarantee is different - * than that provided by isLiteralValue (where literal values are immune to side-effects - * if unescaped) or isImmutableValue (which can be safely aliased). + * Whether the result of the expression node is known to be a primitive value or an object that + * has not yet escaped. * - * The concept of "local values" allow for the containment of side-effect operations. For + *
This guarantee is different than that provided by isLiteralValue (where literal values are + * immune to side-effects if unescaped) or isImmutableValue (which can be safely aliased). + * + *
The concept of "local values" allow for the containment of side-effect operations. For * example, setting a property on a local value does not produce a global side-effect. * - * Note that the concept of "local value" is not deep, it does not say anything - * about the properties of the "local value" (all class instances have "constructor" properties - * that are not local values for instance). + *
Note that the concept of "local value" is not deep, it does not say anything about the + * properties of the "local value" (all class instances have "constructor" properties that are not + * local values for instance). * - * Note that this method only provides the starting state of the expression result, - * it does not guarantee that the value is forever a local value. If the containing - * method has any non-local side-effect, "local values" may escape. + *
Note that this method only provides the starting state of the expression result, it does not
+ * guarantee that the value is forever a local value. If the containing method has any non-local
+ * side-effect, "local values" may escape.
*/
- static boolean evaluatesToLocalValue(Node value, Predicate