…lines 1–95 unchanged (95 lines)
96
97 /**
98 * Adds a node that may represent a function signature (if it's a function
99 * itself or the name of a function).
100 */
101 private void addPossibleSignature(String name, Node node, NodeTraversal t) {
102 boolean signatureAdded = false;
103 if (node.getType() == Token.FUNCTION) {
104 // The node we're looking at is a function, so we can add it directly
105 addSignature(name, node, t.getSourceName());
106 signatureAdded = true;
107 } else if (node.getType() == Token.NAME) {
108 String functionName = node.getString();
109 Scope.Var v = t.getScope().getVar(functionName);
110 if (v == null) {
111 if (compiler.isIdeMode()) {
112 return;
113 } else {
114 throw new IllegalStateException(
115 "VarCheck should have caught this undefined function");
116 }
117 }
118 Node function = v.getInitialValue();
119 if (function != null &&
120 function.getType() == Token.FUNCTION) {
121 addSignature(name, function, v.getInputName());
122 signatureAdded = true;
123 }
124 }
125 if (!signatureAdded) {
126 nonMethodProperties.add(name);
127 }
128 }
129
130 private void addSignature(String name, Node function, String fnSourceName) {
131 if (externMethodsWithoutSignatures.contains(name)) {
132 return;
133 }
…lines 134–276 unchanged (143 lines)