@@ -2,32 +2,46 @@ import javascript
22
33module Electron {
44 /**
5- * A data flow node that is an Electron `webPreferences` property .
5+ * A `webPreferences` object .
66 */
77 class WebPreferences extends DataFlow:: ObjectLiteralNode {
8- WebPreferences ( ) {
9- exists ( BrowserObject bo | this = bo .getOptionArgument ( 0 , "webPreferences" ) .getALocalSource ( ) )
10- }
8+ WebPreferences ( ) { this = any ( NewBrowserObject nbo ) .getWebPreferences ( ) }
119 }
1210
1311 /**
14- * A data flow node that creates a new `BrowserWindow` or `BrowserView`.
12+ * A data flow node that may contain a `BrowserWindow` or `BrowserView` object.
13+ */
14+ abstract private class BrowserObject extends DataFlow:: Node { }
15+
16+ /**
17+ * An instantiation of `BrowserWindow` or `BrowserView`.
1518 */
16- abstract private class BrowserObject extends DataFlow:: NewNode { }
19+ abstract private class NewBrowserObject extends BrowserObject {
20+ DataFlow:: NewNode self ;
21+
22+ NewBrowserObject ( ) { this = self }
23+
24+ /**
25+ * Gets the data flow node from which this instantiation takes its `webPreferences` object.
26+ */
27+ DataFlow:: SourceNode getWebPreferences ( ) {
28+ result = self .getOptionArgument ( 0 , "webPreferences" ) .getALocalSource ( )
29+ }
30+ }
1731
1832 /**
19- * A data flow node that creates a new `BrowserWindow`.
33+ * An instantiation of `BrowserWindow`.
2034 */
21- class BrowserWindow extends BrowserObject {
35+ class BrowserWindow extends NewBrowserObject {
2236 BrowserWindow ( ) {
2337 this = DataFlow:: moduleMember ( "electron" , "BrowserWindow" ) .getAnInstantiation ( )
2438 }
2539 }
2640
2741 /**
28- * A data flow node that creates a new `BrowserView`.
42+ * An instantiation of `BrowserView`.
2943 */
30- class BrowserView extends BrowserObject {
44+ class BrowserView extends NewBrowserObject {
3145 BrowserView ( ) { this = DataFlow:: moduleMember ( "electron" , "BrowserView" ) .getAnInstantiation ( ) }
3246 }
3347
@@ -68,7 +82,7 @@ module Electron {
6882
6983 override DataFlow:: Node getADataNode ( ) {
7084 exists ( string name | name = "write" or name = "end" |
71- result = this .( DataFlow :: SourceNode ) . getAMethodCall ( name ) .getArgument ( 0 )
85+ result = this .getAMethodCall ( name ) .getArgument ( 0 )
7286 )
7387 }
7488 }
0 commit comments