@@ -47,7 +47,7 @@ module API {
4747 * Gets a call to a method on the receiver represented by this API component.
4848 */
4949 DataFlow:: CallNode getAMethodCall ( string method ) {
50- result = getMethodCallNode ( method ) .getAnImmediateUse ( )
50+ result = getReturn ( method ) .getAnImmediateUse ( )
5151 }
5252
5353 /**
@@ -91,12 +91,9 @@ module API {
9191 Node getInstance ( ) { result = getASuccessor ( Label:: instance ( ) ) }
9292
9393 /**
94- * Gets a node representing the result of calling a method on a receiver represented by this node.
95- *
96- * This predicate may have multiple results when there are multiple of the method on this API component.
97- * Consider using `getAMethodCall()` if there is a need to distinguish between individual calls.
94+ * Gets a node representing the result of calling a method on the receiver represented by this node.
9895 */
99- Node getMethodCallNode ( string method ) { result = getASuccessor ( Label:: return ( method ) ) }
96+ Node getReturn ( string method ) { result = getASuccessor ( Label:: return ( method ) ) }
10097
10198 /**
10299 * Gets a `new` call to the function represented by this API component.
@@ -227,9 +224,6 @@ module API {
227224 */
228225 Node moduleImport ( string m ) { result = Impl:: MkModuleImport ( m ) }
229226
230- /** Gets a node corresponding to the built-in with the given name, if any. */
231- Node builtin ( string n ) { result = moduleImport ( "builtins" ) .getMember ( n ) }
232-
233227 /**
234228 * Provides the actual implementation of API graphs, cached for performance.
235229 *
@@ -330,6 +324,7 @@ module API {
330324 ref .asExpr ( ) .getExpr ( ) = call
331325 )
332326 or
327+ // Calling the `new` method on a node that is a use of `base`, which creates a new instance
333328 exists ( MethodCall call , DataFlow:: Node node |
334329 pred .flowsTo ( node ) and
335330 node .asExpr ( ) .getExpr ( ) = call .getReceiver ( ) and
0 commit comments