File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ private import semmle.javascript.security.dataflow.Xss
5
5
6
6
/** Provides classes and predicates modelling aspects of the `d3` library. */
7
7
module D3 {
8
+ /** The global variable `d3` as an entry point for API graphs. */
9
+ private class D3GlobalEntry extends API:: EntryPoint {
10
+ D3GlobalEntry ( ) { this = "D3GlobalEntry" }
11
+
12
+ override DataFlow:: SourceNode getAUse ( ) {
13
+ result = DataFlow:: globalVarRef ( "d3" )
14
+ }
15
+
16
+ override DataFlow:: Node getARhs ( ) { none ( ) }
17
+ }
18
+
8
19
/** Gets an API node referring to the `d3` module. */
9
20
API:: Node d3 ( ) {
10
21
result = API:: moduleImport ( "d3" )
@@ -13,6 +24,8 @@ module D3 {
13
24
result = API:: moduleImport ( any ( string s | s .regexpMatch ( "@.*/d3(-\\w+)?" ) ) )
14
25
or
15
26
result = API:: moduleImport ( "d3-node" ) .getInstance ( ) .getMember ( "d3" )
27
+ or
28
+ result = API:: root ( ) .getASuccessor ( any ( D3GlobalEntry i ) )
16
29
}
17
30
18
31
/**
You can’t perform that action at this time.
0 commit comments