File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -773,7 +773,8 @@ module API {
773
773
// In general, turn store steps into member steps for def-nodes
774
774
exists ( string prop |
775
775
PreCallGraphStep:: storeStep ( rhs , pred , prop ) and
776
- lbl = Label:: member ( prop )
776
+ lbl = Label:: member ( prop ) and
777
+ not DataFlow:: PseudoProperties:: isPseudoProperty ( prop )
777
778
)
778
779
or
779
780
exists ( DataFlow:: FunctionNode fn |
@@ -941,7 +942,6 @@ module API {
941
942
( base instanceof TNonModuleDef or base instanceof TUse )
942
943
)
943
944
or
944
- // invocations
945
945
exists ( DataFlow:: SourceNode src , DataFlow:: SourceNode pred |
946
946
use ( base , src ) and pred = trackUseNode ( src )
947
947
|
@@ -962,6 +962,13 @@ module API {
962
962
or
963
963
ref = cls .getAClassReference ( ) .getAnInstantiation ( )
964
964
)
965
+ or
966
+ exists ( string prop |
967
+ PreCallGraphStep:: loadStep ( pred .getALocalUse ( ) , ref , prop ) and
968
+ lbl = Label:: member ( prop ) and
969
+ // avoid generating member edges like "$arrayElement$"
970
+ not DataFlow:: PseudoProperties:: isPseudoProperty ( prop )
971
+ )
965
972
)
966
973
or
967
974
exists ( DataFlow:: Node def , DataFlow:: FunctionNode fn |
Original file line number Diff line number Diff line change @@ -704,6 +704,10 @@ module SharedFlowStep {
704
704
* For use with load/store steps in `DataFlow::SharedFlowStep` and TypeTracking.
705
705
*/
706
706
module PseudoProperties {
707
+ /** Holds if `s` is a pseudo-property. */
708
+ bindingset [ s]
709
+ predicate isPseudoProperty ( string s ) { s .matches ( "$%$" ) }
710
+
707
711
bindingset [ s]
708
712
private string pseudoProperty ( string s ) { result = "$" + s + "$" }
709
713
You can’t perform that action at this time.
0 commit comments