JS: Add self as global object alias

This commit is contained in:
Asger F
2019-07-24 17:10:59 +01:00
parent 8b60314d85
commit 6f158182d1
4 changed files with 7 additions and 0 deletions

View File

@@ -304,6 +304,9 @@ DataFlow::SourceNode globalObjectRef() {
// Node.js
result = globalVarRef("global")
or
// DOM and service workers
result = globalVarRef("self")
or
// `require("global")`
result = moduleImport("global")
or

View File

@@ -10,3 +10,4 @@
| tst.js:3:1:3:6 | window |
| tst.js:4:1:4:6 | window |
| tst.js:4:1:4:13 | window.window |
| tst.js:5:1:5:4 | self |

View File

@@ -3,11 +3,13 @@
| document | tst2.js:2:1:2:26 | require ... ument") |
| document | tst.js:3:1:3:15 | window.document |
| document | tst.js:4:1:4:22 | window. ... ocument |
| document | tst.js:5:1:5:13 | self.document |
| foo | tst3.js:4:1:4:5 | w.foo |
| global | tst2.js:7:1:7:6 | global |
| global | tst2.js:8:1:8:6 | global |
| goog | tst3.js:1:1:1:4 | goog |
| goog | tst3.js:3:9:3:12 | goog |
| self | tst.js:5:1:5:4 | self |
| setTimeout | tst2.js:5:1:5:12 | g.setTimeout |
| window | tst2.js:3:1:3:24 | require ... indow") |
| window | tst.js:1:1:1:6 | window |

View File

@@ -2,3 +2,4 @@ window;
this;
window.document;
window.window.document;
self.document;