private static boolean isCollapsibleValue(Node value, boolean isLValue) {
    switch (value.getToken()) {
      case GETPROP:
        // Do not collapse GETPROPs on arbitrary objects, because
        // they may be implemented setter functions, and oftentimes
        // setter functions fail on native objects. This is OK for "THIS"
        // objects, because we assume that they are non-native.
        return !isLValue || value.getFirstChild().isThis();

      case NAME:
        return true;

      default:
        return NodeUtil.isImmutableValue(value);
    }
  }
private static boolean isCollapsibleValue ( Node value , boolean isLValue ) { switch ( value . getToken ( ) ) { case GETPROP : return ! isLValue || value . getFirstChild ( ) . isThis ( ) ; case NAME : return true ; default : return NodeUtil . isImmutableValue ( value ) ; } }
Determines whether we know enough about the given value to be able
to collapse it into subsequent expressions.

For example, we can collapse booleans and variable names:
<code>
x = 3; y = x; // y = x = 3;
a = true; b = true; // b = a = true;
<code>
But we won't try to collapse complex expressions.

@param value The value node.
@param isLValue Whether it's on the left-hand side of an expr.