mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JavaScript: Add support for globalThis.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
## General improvements
|
||||
|
||||
* Suppor for `globalThis` has been added.
|
||||
|
||||
* Support for the following frameworks and libraries has been improved:
|
||||
- [firebase](https://www.npmjs.com/package/firebase)
|
||||
- [mongodb](https://www.npmjs.com/package/mongodb)
|
||||
|
||||
@@ -311,6 +311,9 @@ DataFlow::SourceNode globalObjectRef() {
|
||||
// DOM and service workers
|
||||
result = globalVarRef("self")
|
||||
or
|
||||
// ECMAScript 2020
|
||||
result = globalVarRef("globalThis")
|
||||
or
|
||||
// `require("global")`
|
||||
result = moduleImport("global")
|
||||
or
|
||||
|
||||
@@ -11,3 +11,4 @@
|
||||
| tst.js:4:1:4:6 | window |
|
||||
| tst.js:4:1:4:13 | window.window |
|
||||
| tst.js:5:1:5:4 | self |
|
||||
| tst.js:6:1:6:10 | globalThis |
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
| 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 |
|
||||
| document | tst.js:6:1:6:19 | globalThis.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 |
|
||||
| globalThis | tst.js:6:1:6:10 | globalThis |
|
||||
| goog | tst3.js:1:1:1:4 | goog |
|
||||
| goog | tst3.js:3:9:3:12 | goog |
|
||||
| self | tst.js:5:1:5:4 | self |
|
||||
|
||||
@@ -3,3 +3,4 @@ this;
|
||||
window.document;
|
||||
window.window.document;
|
||||
self.document;
|
||||
globalThis.document;
|
||||
|
||||
Reference in New Issue
Block a user