private void processObjectCreateSetCall(Node callNode) {
    Node curParam = callNode.getSecondChild();
    if (canOptimizeObjectCreateSet(curParam)) {
      Node objNode = IR.objectlit().srcref(callNode);
      while (curParam != null) {
        Node keyNode = curParam;
        Node valueNode = IR.trueNode().srcref(keyNode);

        curParam = curParam.getNext();
        callNode.removeChild(keyNode);

        addKeyValueToObjLit(objNode, keyNode, valueNode);
      }
      callNode.replaceWith(objNode);
      compiler.reportChangeToEnclosingScope(objNode);
    }
  }
private void processObjectCreateSetCall ( Node callNode ) { Node curParam = callNode . getSecondChild ( ) ; if ( canOptimizeObjectCreateSet ( curParam ) ) { Node objNode = IR . objectlit ( ) . srcref ( callNode ) ; while ( curParam != null ) { Node keyNode = curParam ; Node valueNode = IR . trueNode ( ) . srcref ( keyNode ) ; curParam = curParam . getNext ( ) ; callNode . removeChild ( keyNode ) ; addKeyValueToObjLit ( objNode , keyNode , valueNode ) ; } callNode . replaceWith ( objNode ) ; compiler . reportChangeToEnclosingScope ( objNode ) ; } }
Converts all of the given call nodes to object literals that are safe to
do so.