private void print(PropertyGet node) throws IOException { print(node.getLeft(), PRECEDENCE_MEMBER); writer.append('.'); Map<String, NameEmitter> oldNameMap = nameMap; nameMap = Collections.emptyMap(); print(node.getRight()); nameMap = oldNameMap; }
/** * Returns the property being accessed. */ public Name getProperty() { return (Name)getRight(); }
/** * Returns the property being accessed. */ public Name getProperty() { return (Name)getRight(); }
/** * Returns the property being accessed. */ public Name getProperty() { return (Name)getRight(); }
/** * Returns the property being accessed. */ public Name getProperty() { return (Name)getRight(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
public static boolean isPrototypePropertyGet(PropertyGet pg) { return pg!=null && pg.getLeft() instanceof Name && isPrototypeNameNode(pg.getRight()); }
private void getChainedPropertyGetNodesImpl(PropertyGet pg, List<AstNode> nodes){ if (pg.getLeft() instanceof PropertyGet) { getChainedPropertyGetNodesImpl((PropertyGet)pg.getLeft(), nodes); } else { nodes.add(pg.getLeft()); } nodes.add(pg.getRight()); }
private void print(PropertyGet node) throws IOException { print(node.getLeft(), PRECEDENCE_MEMBER); writer.append('.'); Map<String, NameEmitter> oldNameMap = nameMap; nameMap = Collections.emptyMap(); print(node.getRight()); nameMap = oldNameMap; }
/** * Returns whether a <code>PropertyGet</code> is a simple one, referencing * an object's value 1 level deep. For example, <code>Object.create</code>. * * @param pg The <code>PropertyGet</code>. * @param expectedObj The expected object value. * @param expectedField The expected string value. * @return Whether the object is what was expected. */ public static boolean isSimplePropertyGet(PropertyGet pg, String expectedObj, String expectedField) { return pg!=null && isName(pg.getLeft(), expectedObj) && isName(pg.getRight(), expectedField); }