mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: More robust hasUnderlyingType
This commit is contained in:
@@ -1,2 +1,6 @@
|
||||
underlyingTypeNode
|
||||
| foo | Bar | foo.ts:3:1:5:1 | use (instance (member Bar (member exports (module foo)))) |
|
||||
| foo | Bar | foo.ts:3:12:3:12 | use (instance (member Bar (member exports (module foo)))) |
|
||||
#select
|
||||
| tst.ts:8:14:8:16 | arg | Base in global scope |
|
||||
| tst.ts:8:14:8:16 | arg | Sub in global scope |
|
||||
|
||||
@@ -3,3 +3,7 @@ import javascript
|
||||
from Expr e, TypeName typeName
|
||||
where e.getType().hasUnderlyingTypeName(typeName)
|
||||
select e, typeName
|
||||
|
||||
query API::Node underlyingTypeNode(string mod, string name) {
|
||||
result = API::Node::ofType(mod, name)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import foo from "foo";
|
||||
|
||||
function f(x: foo.Bar) {
|
||||
return x;
|
||||
}
|
||||
Reference in New Issue
Block a user