mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Use type info and type tracking in jQuery
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
| tracking.js:7:5:7:24 | this.elm.html('foo') | html |
|
||||
| tracking.js:14:5:14:17 | e.html('foo') | html |
|
||||
| tracking.js:18:7:18:15 | $('#foo') | $ |
|
||||
| ts_global_types.ts:3:5:3:17 | e.html('foo') | html |
|
||||
| ts_global_types.ts:7:1:7:9 | $('#foo') | $ |
|
||||
| ts_import.ts:5:5:5:17 | e.html('foo') | html |
|
||||
| tst2.js:2:1:2:7 | jq("a") | $ |
|
||||
| tst.js:1:1:1:3 | $() | $ |
|
||||
| tst.js:2:1:2:8 | jQuery() | $ |
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
| tracking.js:7:5:7:24 | this.elm.html('foo') | tracking.js:7:19:7:23 | 'foo' |
|
||||
| tracking.js:14:5:14:17 | e.html('foo') | tracking.js:14:12:14:16 | 'foo' |
|
||||
| tracking.js:18:7:18:15 | $('#foo') | tracking.js:18:9:18:14 | '#foo' |
|
||||
| ts_global_types.ts:3:5:3:17 | e.html('foo') | ts_global_types.ts:3:12:3:16 | 'foo' |
|
||||
| ts_global_types.ts:7:1:7:9 | $('#foo') | ts_global_types.ts:7:3:7:8 | '#foo' |
|
||||
| ts_import.ts:5:5:5:17 | e.html('foo') | ts_import.ts:5:12:5:16 | 'foo' |
|
||||
| tst2.js:2:1:2:7 | jq("a") | tst2.js:2:4:2:6 | "a" |
|
||||
| tst.js:3:1:3:9 | $("<a/>") | tst.js:3:3:3:8 | "<a/>" |
|
||||
| tst.js:7:1:7:14 | $("<br>", doc) | tst.js:7:3:7:8 | "<br>" |
|
||||
|
||||
5
javascript/ql/test/library-tests/frameworks/jQuery/jquery.d.ts
vendored
Normal file
5
javascript/ql/test/library-tests/frameworks/jQuery/jquery.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
interface JQuery {}
|
||||
|
||||
declare module 'jquery' {
|
||||
export = JQuery;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
class C {
|
||||
constructor(elm) {
|
||||
this.elm = elm;
|
||||
}
|
||||
|
||||
doSomething() {
|
||||
this.elm.html('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {JQuery} e
|
||||
*/
|
||||
doSomethingWithTypes(e) {
|
||||
e.html('foo');
|
||||
}
|
||||
}
|
||||
|
||||
new C($('#foo'));
|
||||
@@ -0,0 +1,7 @@
|
||||
class MyClass {
|
||||
foo2(e: JQuery) {
|
||||
e.html('foo');
|
||||
}
|
||||
}
|
||||
|
||||
$('#foo');
|
||||
@@ -0,0 +1,7 @@
|
||||
import jQuery = require('jquery');
|
||||
|
||||
class MyClass {
|
||||
foo3(e: jQuery) {
|
||||
e.html('foo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"include": ["."]}
|
||||
Reference in New Issue
Block a user