mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
JS: Restrict size of hasNameParts
Test updates look OK. Some intermediate results are omitted but the qualified name of the final type names are still present.
This commit is contained in:
@@ -372,6 +372,7 @@ class JSDocNamedTypeExpr extends JSDocTypeExpr {
|
||||
* - `Baz` has prefix `Baz` and an empty suffix.
|
||||
*/
|
||||
predicate hasNameParts(string prefix, string suffix) {
|
||||
not this = any(JSDocQualifiedTypeAccess a).getBase() and // restrict size of predicate
|
||||
exists(string regex, string name | regex = "([^.]+)(.*)" |
|
||||
name = this.getRawName() and
|
||||
prefix = name.regexpCapture(regex, 1) and
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
| bar.js:5:14:5:18 | x | ns.very.long.namespace |
|
||||
| bar.js:5:14:5:18 | x | x |
|
||||
| bar.js:5:14:5:18 | x.Foo | ns.very.long.namespace.Foo |
|
||||
| bar.js:12:14:12:21 | iife | IIFE |
|
||||
| bar.js:12:14:12:21 | iife | iife |
|
||||
| bar.js:12:14:12:21 | iife.Foo | IIFE.Foo |
|
||||
| closure.js:8:12:8:28 | goog | goog |
|
||||
| closure.js:8:12:8:28 | goog.net | goog.net |
|
||||
| closure.js:8:12:8:28 | goog.net.SomeType | goog.net.SomeType |
|
||||
| closure.js:9:12:9:23 | net | goog.net |
|
||||
| closure.js:9:12:9:23 | net | net |
|
||||
| closure.js:9:12:9:23 | net.SomeType | goog.net.SomeType |
|
||||
| closure.js:10:12:10:19 | SomeType | goog.net.SomeType |
|
||||
|
||||
Reference in New Issue
Block a user