File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ private import semmle.javascript.security.dataflow.Xss
55
66/** Provides classes and predicates modelling aspects of the `d3` library. */
77module 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+
819 /** Gets an API node referring to the `d3` module. */
920 API:: Node d3 ( ) {
1021 result = API:: moduleImport ( "d3" )
@@ -13,6 +24,8 @@ module D3 {
1324 result = API:: moduleImport ( any ( string s | s .regexpMatch ( "@.*/d3(-\\w+)?" ) ) )
1425 or
1526 result = API:: moduleImport ( "d3-node" ) .getInstance ( ) .getMember ( "d3" )
27+ or
28+ result = API:: root ( ) .getASuccessor ( any ( D3GlobalEntry i ) )
1629 }
1730
1831 /**
You can’t perform that action at this time.
0 commit comments