File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed
src/semmle/javascript/dataflow Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,9 @@ DataFlow::SourceNode globalObjectRef() {
284284 or
285285 // `require("global")`
286286 result = moduleImport ( "global" )
287+ or
288+ // Closure library - based on AST to avoid recursion with Closure library model
289+ result = globalVarRef ( "goog" ) .getAPropertyRead ( "global" )
287290}
288291
289292/**
Original file line number Diff line number Diff line change 33| tst2.js:3:1:3:24 | require ... indow") |
44| tst2.js:7:1:7:6 | global |
55| tst2.js:8:1:8:6 | global |
6+ | tst3.js:1:1:1:0 | this |
7+ | tst3.js:3:9:3:19 | goog.global |
68| tst.js:1:1:1:0 | this |
79| tst.js:1:1:1:6 | window |
810| tst.js:3:1:3:6 | window |
Original file line number Diff line number Diff line change 33| document | tst2.js:2:1:2:26 | require ... ument") |
44| document | tst.js:3:1:3:15 | window.document |
55| document | tst.js:4:1:4:22 | window. ... ocument |
6+ | foo | tst3.js:4:1:4:5 | w.foo |
67| global | tst2.js:7:1:7:6 | global |
78| global | tst2.js:8:1:8:6 | global |
9+ | goog | tst3.js:1:1:1:4 | goog |
10+ | goog | tst3.js:3:9:3:12 | goog |
811| setTimeout | tst2.js:5:1:5:12 | g.setTimeout |
912| window | tst2.js:3:1:3:24 | require ... indow") |
1013| window | tst.js:1:1:1:6 | window |
Original file line number Diff line number Diff line change 1+ goog . module ( 'test' ) ;
2+
3+ let w = goog . global ;
4+ w . foo ;
You can’t perform that action at this time.
0 commit comments