mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
JS: Add JSDoc name resolution test
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
function test() {
|
||||
let x = ns.very.long.namespace;
|
||||
|
||||
/**
|
||||
* @param {x.Foo} foo
|
||||
*/
|
||||
function f(foo) {}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
goog.module('test');
|
||||
|
||||
let net = goog.require('goog.net');
|
||||
|
||||
let { SomeType } = net;
|
||||
|
||||
/**
|
||||
* @param {goog.net.SomeType} xio
|
||||
* @param {net.SomeType} xio2
|
||||
* @param {SomeType} xio3
|
||||
*/
|
||||
function test(xio, xio2, xio3) {
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
ns = ns || {};
|
||||
|
||||
ns.very.long.namespace.Foo = class {};
|
||||
@@ -0,0 +1,4 @@
|
||||
| bar.js:5:14:5:18 | x.Foo | ns.very.long.namespace.Foo |
|
||||
| closure.js:8:12:8:28 | goog.net.SomeType | goog.net.SomeType |
|
||||
| closure.js:9:12:9:23 | net.SomeType | goog.net.SomeType |
|
||||
| closure.js:10:12:10:19 | SomeType | goog.net.SomeType |
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query string test_hasQualifiedName(JSDocNamedTypeExpr expr) {
|
||||
expr.hasQualifiedName(result)
|
||||
}
|
||||
Reference in New Issue
Block a user