Skip to content

Commit 70c867a

Browse files
committed
JS: Recgonise default-export from 'jquery' as a type
1 parent 2118638 commit 70c867a

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

javascript/ql/lib/semmle/javascript/frameworks/jQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ module JQuery {
410410
this = DataFlow::moduleImport(["jquery", "zepto", "cash-dom"])
411411
or
412412
this.hasUnderlyingType("JQueryStatic")
413+
or
414+
this.hasUnderlyingType("jquery", "")
413415
}
414416
}
415417
}

javascript/ql/test/library-tests/frameworks/jQuery/JQueryMethodCall.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| tracking.js:23:7:23:15 | $('#foo') | $ |
66
| ts_global_types.ts:3:5:3:17 | e.html('foo') | html |
77
| ts_global_types.ts:7:1:7:9 | $('#foo') | $ |
8+
| ts_import.ts:5:5:5:17 | e.html('foo') | html |
89
| tst2.js:2:1:2:7 | jq("a") | $ |
910
| tst.js:1:1:1:3 | $() | $ |
1011
| tst.js:2:1:2:8 | jQuery() | $ |

javascript/ql/test/library-tests/frameworks/jQuery/interpretsArgumentAsHtml.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| tracking.js:23:7:23:15 | $('#foo') | tracking.js:23:9:23:14 | '#foo' |
44
| ts_global_types.ts:3:5:3:17 | e.html('foo') | ts_global_types.ts:3:12:3:16 | 'foo' |
55
| ts_global_types.ts:7:1:7:9 | $('#foo') | ts_global_types.ts:7:3:7:8 | '#foo' |
6+
| ts_import.ts:5:5:5:17 | e.html('foo') | ts_import.ts:5:12:5:16 | 'foo' |
67
| tst2.js:2:1:2:7 | jq("a") | tst2.js:2:4:2:6 | "a" |
78
| tst.js:3:1:3:9 | $("<a/>") | tst.js:3:3:3:8 | "<a/>" |
89
| tst.js:7:1:7:14 | $("<br>", doc) | tst.js:7:3:7:8 | "<br>" |

0 commit comments

Comments
 (0)