File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
lib/semmle/javascript/frameworks
test/library-tests/frameworks/Electron Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,19 @@ module Electron {
41
41
BrowserView ( ) { this = DataFlow:: moduleMember ( "electron" , "BrowserView" ) .getAnInstantiation ( ) }
42
42
}
43
43
44
- /**
45
- * An expression of type `BrowserWindow` or `BrowserView`.
46
- */
47
- private class BrowserObjectByType extends BrowserObject {
48
- BrowserObjectByType ( ) {
49
- exists ( string tp | tp = "BrowserWindow" or tp = "BrowserView" |
50
- this .asExpr ( ) .getType ( ) .hasUnderlyingType ( "electron" , tp )
51
- )
44
+ private class ElectronEntryPoint extends API:: EntryPoint {
45
+ ElectronEntryPoint ( ) { this = "Electron.Browser" }
46
+
47
+ override DataFlow:: SourceNode getASource ( ) {
48
+ result .hasUnderlyingType ( [ "Electron.BrowserWindow" , "Electron.BrowserView" ] )
52
49
}
53
50
}
54
51
55
- private API:: Node browserObject ( ) { result .asSource ( ) instanceof NewBrowserObject }
52
+ private API:: Node browserObject ( ) {
53
+ result .asSource ( ) instanceof NewBrowserObject or
54
+ result = API:: Node:: ofType ( "electron" , [ "BrowserWindow" , "BrowserView" ] ) or
55
+ result = any ( ElectronEntryPoint e ) .getANode ( )
56
+ }
56
57
57
58
/**
58
59
* A data flow node whose value may originate from a browser object instantiation.
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ browserObject
16
16
| electron.js:63:3:63:5 | win |
17
17
| electron.js:65:18:65:20 | win |
18
18
| electronTs.ts:3:12:3:13 | bw |
19
+ | electronTs.ts:3:12:3:13 | bw |
20
+ | electronTs.ts:3:40:3:41 | bv |
19
21
| electronTs.ts:3:40:3:41 | bv |
20
22
| electronTs.ts:4:3:4:4 | bw |
21
23
| electronTs.ts:5:3:5:4 | bv |
You can’t perform that action at this time.
0 commit comments