mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Merge pull request #936 from xiemaisi/js/revive-electron-support
Approved by esben-semmle
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
| electron.d.ts:2:16:2:28 | BrowserWindow |
|
||||
| electron.d.ts:3:16:3:26 | BrowserView |
|
||||
| electron.js:3:5:3:48 | bw |
|
||||
| electron.js:3:10:3:48 | new Bro ... s: {}}) |
|
||||
| electron.js:4:5:4:46 | bv |
|
||||
| electron.js:4:10:4:46 | new Bro ... s: {}}) |
|
||||
| electron.js:35:14:35:14 | x |
|
||||
| electron.js:36:12:36:12 | x |
|
||||
| electron.js:39:1:39:7 | foo(bw) |
|
||||
| electron.js:39:5:39:6 | bw |
|
||||
| electron.js:40:1:40:7 | foo(bv) |
|
||||
| electron.js:40:5:40:6 | bv |
|
||||
| electron.ts:3:12:3:13 | bw |
|
||||
| electron.ts:3:40:3:41 | bv |
|
||||
| electron.ts:4:3:4:4 | bw |
|
||||
| electron.ts:5:3:5:4 | bv |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from Electron::BrowserObject obj
|
||||
select obj
|
||||
@@ -0,0 +1,4 @@
|
||||
| electron.js:43:30:43:35 | 'pong' | electron.js:52:33:52:35 | arg |
|
||||
| electron.js:48:23:48:28 | 'pong' | electron.js:58:1:58:36 | ipcRend ... 'ping') |
|
||||
| electron.js:56:27:56:32 | 'ping' | electron.js:42:29:42:31 | arg |
|
||||
| electron.js:58:30:58:35 | 'ping' | electron.js:47:28:47:30 | arg |
|
||||
@@ -0,0 +1,9 @@
|
||||
import javascript
|
||||
|
||||
class TestConfig extends DataFlow::Configuration {
|
||||
TestConfig() { this = "TestConfig" }
|
||||
}
|
||||
|
||||
from TestConfig cfg, DataFlow::Node pred, DataFlow::Node succ
|
||||
where cfg.isAdditionalFlowStep(pred, succ)
|
||||
select pred, succ
|
||||
@@ -0,0 +1,4 @@
|
||||
| electron.js:39:1:39:19 | foo(bw).webContents |
|
||||
| electron.js:40:1:40:19 | foo(bv).webContents |
|
||||
| electron.ts:4:3:4:16 | bw.webContents |
|
||||
| electron.ts:5:3:5:16 | bv.webContents |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from Electron::WebContents wc
|
||||
select wc
|
||||
@@ -1,2 +1,2 @@
|
||||
| electron.js:3:36:3:37 | {} |
|
||||
| electron.js:4:34:4:35 | {} |
|
||||
| electron.js:3:45:3:46 | {} |
|
||||
| electron.js:4:43:4:44 | {} |
|
||||
|
||||
8
javascript/ql/test/library-tests/frameworks/Electron/electron.d.ts
vendored
Normal file
8
javascript/ql/test/library-tests/frameworks/Electron/electron.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
declare namespace Electron {
|
||||
export class BrowserWindow { }
|
||||
export class BrowserView { }
|
||||
}
|
||||
|
||||
declare module 'electron' {
|
||||
export = Electron;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
const {BrowserView, BrowserWindow, ClientRequest, net} = require('electron')
|
||||
const { ipcMain, ipcRenderer, BrowserView, BrowserWindow, ClientRequest, net } = require('electron')
|
||||
|
||||
new BrowserWindow({webPreferences: {}})
|
||||
new BrowserView({webPreferences: {}})
|
||||
var bw = new BrowserWindow({webPreferences: {}})
|
||||
var bv = new BrowserView({webPreferences: {}})
|
||||
|
||||
function makeClientRequests() {
|
||||
net.request('https://example.com').end();
|
||||
@@ -31,3 +31,28 @@ function makeClientRequests() {
|
||||
post.write('stuff');
|
||||
post.end('more stuff');
|
||||
}
|
||||
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
foo(bw).webContents;
|
||||
foo(bv).webContents;
|
||||
|
||||
ipcMain.on('async', (event, arg) => {
|
||||
event.sender.send('reply', 'pong');
|
||||
arg
|
||||
});
|
||||
|
||||
ipcMain.on('sync', (event, arg) => {
|
||||
event.returnValue = 'pong';
|
||||
arg
|
||||
});
|
||||
|
||||
ipcRenderer.on('reply', (event, arg) => {
|
||||
arg
|
||||
});
|
||||
|
||||
ipcRenderer.send('async', 'ping');
|
||||
|
||||
ipcRenderer.sendSync('sync', 'ping');
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
///<reference path="./electron.d.ts"/>
|
||||
|
||||
function f(bw: Electron.BrowserWindow, bv: Electron.BrowserView) {
|
||||
bw.webContents;
|
||||
bv.webContents;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"include": ["."]
|
||||
}
|
||||
Reference in New Issue
Block a user