@@ -97,6 +97,11 @@ module API {
9797 */
9898 Node getASubclass ( ) { result = getASuccessor ( Label:: subclass ( ) ) }
9999
100+ /**
101+ * Gets a node representing the result from awaiting this node.
102+ */
103+ Node getAwaited ( ) { result = getASuccessor ( Label:: await ( ) ) }
104+
100105 /**
101106 * Gets a string representation of the lexicographically least among all shortest access paths
102107 * from the root to this node.
@@ -469,6 +474,14 @@ module API {
469474 exists ( DataFlow:: Node superclass | pred .flowsTo ( superclass ) |
470475 ref .asExpr ( ) .( ClassExpr ) .getABase ( ) = superclass .asExpr ( )
471476 )
477+ or
478+ // awaiting
479+ exists ( Await await , DataFlow:: Node awaitedValue |
480+ lbl = Label:: await ( ) and
481+ ref .asExpr ( ) = await and
482+ await .getValue ( ) = awaitedValue .asExpr ( ) and
483+ pred .flowsTo ( awaitedValue )
484+ )
472485 )
473486 or
474487 // Built-ins, treated as members of the module `builtins`
@@ -585,5 +598,9 @@ private module Label {
585598 /** Gets the `return` edge label. */
586599 string return ( ) { result = "getReturn()" }
587600
601+ /** Gets the `subclass` edge label. */
588602 string subclass ( ) { result = "getASubclass()" }
603+
604+ /** Gets the `await` edge label. */
605+ string await ( ) { result = "getAwaited()" }
589606}
0 commit comments