@@ -347,6 +347,16 @@ module API {
347347 result = this .getASuccessor ( Label:: promisedError ( ) )
348348 }
349349
350+ /**
351+ * Gets a node representing a function that wraps the current value, forwarding arguments and
352+ * return values.
353+ */
354+ cached
355+ Node getForwardingFunction ( ) {
356+ Stages:: ApiStage:: ref ( ) and
357+ result = this .getASuccessor ( Label:: forwardingFunction ( ) )
358+ }
359+
350360 /**
351361 * Gets any class that has this value as a decorator.
352362 *
@@ -901,6 +911,9 @@ module API {
901911 or
902912 lbl = Label:: return ( ) and
903913 ref = pred .getAnInvocation ( )
914+ or
915+ lbl = Label:: forwardingFunction ( ) and
916+ DataFlow:: functionForwardingStep ( pred .getALocalUse ( ) , ref )
904917 )
905918 or
906919 exists ( DataFlow:: Node def , DataFlow:: FunctionNode fn |
@@ -1431,6 +1444,9 @@ module API {
14311444 /** Gets the `return` edge label. */
14321445 LabelReturn return ( ) { any ( ) }
14331446
1447+ /** Gets the label representing a function wrapper that forwards to an underlying function. */
1448+ LabelForwardingFunction forwardingFunction ( ) { any ( ) }
1449+
14341450 /** Gets the `promised` edge label connecting a promise to its contained value. */
14351451 LabelPromised promised ( ) { any ( ) }
14361452
@@ -1483,6 +1499,7 @@ module API {
14831499 MkLabelDecoratedClass ( ) or
14841500 MkLabelDecoratedMember ( ) or
14851501 MkLabelDecoratedParameter ( ) or
1502+ MkLabelForwardingFunction ( ) or
14861503 MkLabelEntryPoint ( API:: EntryPoint e )
14871504
14881505 /** A label for an entry-point. */
@@ -1566,6 +1583,11 @@ module API {
15661583 override string toString ( ) { result = "getReceiver()" }
15671584 }
15681585
1586+ /** A label for a function that is a wrapper around another function. */
1587+ class LabelForwardingFunction extends ApiLabel , MkLabelForwardingFunction {
1588+ override string toString ( ) { result = "getForwardingFunction()" }
1589+ }
1590+
15691591 /** A label for a class decorated by the current value. */
15701592 class LabelDecoratedClass extends ApiLabel , MkLabelDecoratedClass {
15711593 override string toString ( ) { result = "getADecoratedClass()" }
0 commit comments