Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 593179472
  • Loading branch information
nbeloglazov authored and copybara-github committed Dec 23, 2023
1 parent edd5613 commit d10204d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/com/google/javascript/jscomp/SymbolTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,8 @@ private boolean maybeDefineTypedReference(Node n, String propName, JSType owner)
}
// There is no handy way to find symbol object the given property node. So we do
// property node => namespace node => namespace symbol => property symbol.
if (propNodeDecl != null && propNodeDecl.isGetProp()) {
if (propNodeDecl != null
&& (propNodeDecl.isGetProp() || propNodeDecl.isOptChainGetProp())) {
Node namespace = propNodeDecl.getFirstChild();
Symbol namespaceSym = getSymbolForName(namespace, namespace.getQualifiedName());
if (namespaceSym != null && namespaceSym.getPropertyScope() != null) {
Expand Down Expand Up @@ -2018,7 +2019,7 @@ public void visit(NodeTraversal t, Node n, Node parent) {
// definitions. e.g., for "a.b", it's more useful to record
// this as "property b of the type of a", than as "symbol a.b".

if (n.isGetProp()) {
if (n.isGetProp() || n.isOptChainGetProp()) {
JSType owner = n.getFirstChild().getJSType();
if (owner != null) {
boolean defined = maybeDefineTypedReference(n, n.getString(), owner);
Expand Down Expand Up @@ -2229,7 +2230,7 @@ private VisibilityCollector(ImmutableMap<StaticSourceFile, Visibility> fileVisib
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isName()) {
visitName(t, n);
} else if (n.isGetProp()) {
} else if (n.isGetProp() || n.isOptChainGetProp()) {
visitProperty(n, parent);
}
}
Expand Down

0 comments on commit d10204d

Please sign in to comment.