@Override public boolean enterAccessNode(AccessNode accessNode) { if (typeOffset == -1) { typeOffset = accessNode.getFinish() - accessNode.getProperty().length(); } accessNode.getBase().accept(this); exp.add(accessNode.getProperty()); return false; }
if (callNode.getFunction() instanceof AccessNode) { AccessNode anode = (AccessNode)callNode.getFunction(); callOffset = anode.getFinish() - anode.getProperty().length();
private static List<Identifier> getName(AccessNode aNode, ParserResult parserResult) { List<Identifier> name = new ArrayList(); name.add(new Identifier(aNode.getProperty(), new OffsetRange(aNode.getFinish() - aNode.getProperty().length(), aNode.getFinish()))); Node base = aNode.getBase(); while (base instanceof AccessNode || base instanceof CallNode || base instanceof IndexNode) { base = aaNode.getBase(); name.add(new Identifier(aaNode.getProperty(), new OffsetRange(aaNode.getFinish() - aaNode.getProperty().length(), aaNode.getFinish())));
@Override public boolean enterAccessNode(AccessNode accessNode) { BinaryNode node = getPath().get(getPath().size() - 1) instanceof BinaryNode ? (BinaryNode)getPath().get(getPath().size() - 1) : null; if (!(node != null && node.tokenType() == TokenType.ASSIGN)) { if (accessNode.getBase() instanceof IdentNode && ModelUtils.THIS.equals(((IdentNode)accessNode.getBase()).getName())) { //NOI18N String iNode = accessNode.getProperty(); JsObject current = modelBuilder.getCurrentDeclarationFunction(); JsObject property = current.getProperty(iNode); if (property == null && current.getParent() != null && (current.getParent().getJSKind() == JsElement.Kind.CONSTRUCTOR || current.getParent().getJSKind() == JsElement.Kind.OBJECT)) { current = current.getParent(); property = current.getProperty(iNode); if (property == null && ModelUtils.PROTOTYPE.equals(current.getName())) { current = current.getParent(); property = current.getProperty(iNode); } } if (property == null && current.getParent() == null) { // probably we are in global space and there is used this property = modelBuilder.getGlobal().getProperty(iNode); } if (property != null && !property.getModifiers().contains(Modifier.PRIVATE)) { // we don't want to add occurrences for cases like var buf = this.buf. See issue #267694 ((JsObjectImpl)property).addOccurrence(new OffsetRange(accessNode.getFinish() - iNode.length(), accessNode.getFinish())); } } } return super.enterAccessNode(accessNode); }
if (!returnTypes.isEmpty()) { for (Type type : returnTypes) { property.addAssignment(new TypeUsage(type.getType(), type.getOffset(), true), accessNode.getFinish());