@@ -79,7 +79,7 @@ module API {
79
79
/**
80
80
* Gets a call to the function represented by this API component.
81
81
*/
82
- DataFlow:: CallCfgNode getACall ( ) { result = this .getReturn ( ) .getAnImmediateUse ( ) } // TODO: Make a API::CallNode.
82
+ DataFlow:: CallCfgNode getACall ( ) { result = this .getReturn ( ) .getAnImmediateUse ( ) } // TODO: Make a API::CallNode. After I figure out named parameters
83
83
84
84
/**
85
85
* Gets a node representing member `m` of this API component.
@@ -441,7 +441,6 @@ module API {
441
441
)
442
442
}
443
443
444
- // TODO: Compare with JS, check that I'm not missing stuff
445
444
/**
446
445
* Holds if `rhs` is the right-hand side of a definition of a node that should have an
447
446
* incoming edge from `base` labeled `lbl` in the API graph.
@@ -470,30 +469,31 @@ module API {
470
469
lbl = Label:: member ( item .getKey ( ) .( StrConst ) .getS ( ) ) and
471
470
rhs .asExpr ( ) = item .getValue ( )
472
471
)
473
- // or
474
- // special case: from `require('m')` to an export of `prop` in `m`
475
- // TODO: Figure out if this is needed.
476
- /*
477
- * exists(Import imp, Module m, string prop |
478
- * pred = imp.getImportedModuleNode() and
479
- * m = imp.getImportedModule() and
480
- * lbl = Label::member(prop) and
481
- * rhs = m.getAnExportedValue(prop)
482
- * )
483
- * or
484
- * // TODO:
485
- * exists(DataFlow::FunctionNode fn | fn = pred |
486
- * not fn.getFunction().isAsync() and
487
- * lbl = Label::return() and
488
- * rhs = fn.getAReturn()
489
- * )
490
- * or
491
- * lbl = Label::promised() and
492
- * PromiseFlow::storeStep(rhs, pred, Promises::valueProp())
493
- */
494
-
472
+ or
473
+ exists ( CallableExpr fn | fn = pred .asExpr ( ) |
474
+ not fn .getInnerScope ( ) .isAsync ( ) and
475
+ lbl = Label:: return ( ) and
476
+ exists ( Return ret |
477
+ rhs .asExpr ( ) = ret .getValue ( ) and
478
+ ret .getScope ( ) = fn .getInnerScope ( )
479
+ )
495
480
)
481
+ )
496
482
or
483
+ // or
484
+ // special case: from `require('m')` to an export of `prop` in `m`
485
+ // TODO: Figure out if this is needed.
486
+ /*
487
+ * exists(Import imp, Module m, string prop |
488
+ * pred = imp.getImportedModuleNode() and
489
+ * m = imp.getImportedModule() and
490
+ * lbl = Label::member(prop) and
491
+ * rhs = m.getAnExportedValue(prop)
492
+ * )
493
+ * or
494
+ * // TODO:
495
+ */
496
+
497
497
/*
498
498
* or // TODO:
499
499
* exists(DataFlow::FunctionNode f |
@@ -727,6 +727,7 @@ module API {
727
727
succ = MkDef ( rhs )
728
728
)
729
729
// TODO: Compare with JS, check that I'm not missing stuff
730
+ // TODO: Port MkAsyncFuncResult?
730
731
}
731
732
732
733
/**
0 commit comments