mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JS: Update type usage in Electron model
This commit is contained in:
@@ -41,18 +41,19 @@ module Electron {
|
||||
BrowserView() { this = DataFlow::moduleMember("electron", "BrowserView").getAnInstantiation() }
|
||||
}
|
||||
|
||||
/**
|
||||
* An expression of type `BrowserWindow` or `BrowserView`.
|
||||
*/
|
||||
private class BrowserObjectByType extends BrowserObject {
|
||||
BrowserObjectByType() {
|
||||
exists(string tp | tp = "BrowserWindow" or tp = "BrowserView" |
|
||||
this.asExpr().getType().hasUnderlyingType("electron", tp)
|
||||
)
|
||||
private class ElectronEntryPoint extends API::EntryPoint {
|
||||
ElectronEntryPoint() { this = "Electron.Browser" }
|
||||
|
||||
override DataFlow::SourceNode getASource() {
|
||||
result.hasUnderlyingType(["Electron.BrowserWindow", "Electron.BrowserView"])
|
||||
}
|
||||
}
|
||||
|
||||
private API::Node browserObject() { result.asSource() instanceof NewBrowserObject }
|
||||
private API::Node browserObject() {
|
||||
result.asSource() instanceof NewBrowserObject or
|
||||
result = API::Node::ofType("electron", ["BrowserWindow", "BrowserView"]) or
|
||||
result = any(ElectronEntryPoint e).getANode()
|
||||
}
|
||||
|
||||
/**
|
||||
* A data flow node whose value may originate from a browser object instantiation.
|
||||
|
||||
@@ -16,6 +16,8 @@ browserObject
|
||||
| electron.js:63:3:63:5 | win |
|
||||
| electron.js:65:18:65:20 | win |
|
||||
| electronTs.ts:3:12:3:13 | bw |
|
||||
| electronTs.ts:3:12:3:13 | bw |
|
||||
| electronTs.ts:3:40:3:41 | bv |
|
||||
| electronTs.ts:3:40:3:41 | bv |
|
||||
| electronTs.ts:4:3:4:4 | bw |
|
||||
| electronTs.ts:5:3:5:4 | bv |
|
||||
|
||||
Reference in New Issue
Block a user