Skip to content

Commit

Permalink
When looking for the source file associated with a property definitio…
Browse files Browse the repository at this point in the history
…n use the

node rather than the node associated with the JSDocInfo object.

This paves the way for removing the "associated node" in the JSDocInfo object.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=90735696
  • Loading branch information
concavelenz authored and blickly committed Apr 11, 2015
1 parent 40db88a commit 2a2c1d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/com/google/javascript/jscomp/CheckAccessControls.java
Expand Up @@ -30,6 +30,7 @@
import com.google.javascript.rhino.jstype.JSType;
import com.google.javascript.rhino.jstype.JSTypeNative;
import com.google.javascript.rhino.jstype.ObjectType;
import com.google.javascript.rhino.jstype.Property;

import java.util.ArrayDeque;

Expand Down Expand Up @@ -670,9 +671,9 @@ && propertyIsDeclaredButNotPrivate(getprop, parent)) {
}

if (objectType != null) {
JSDocInfo docInfo = objectType.getOwnPropertyJSDocInfo(propertyName);
definingSource = docInfo.getStaticSourceFile();
isClassType = docInfo.isConstructor();
Property p = objectType.getOwnSlot(propertyName);
definingSource = p.getNode().getStaticSourceFile();
isClassType = p.getJSDocInfo().isConstructor();
} else if (isPrivateByConvention) {
// We can only check visibility references if we know what file
// it was defined in.
Expand Down

0 comments on commit 2a2c1d5

Please sign in to comment.