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 ) ; } }
Determines whether we know enough about the given value to be able to collapse it into subsequent expressions .