зеркало из https://github.com/github/codeql.git
Merge pull request #1828 from asger-semmle/jsdoc-relation
JS: Make getDocumentation handle chain assignments
This commit is contained in:
Коммит
742c9708a9
|
@ -18,3 +18,5 @@
|
|||
| Client-side cross-site scripting (`js/xss`) | More results | More potential vulnerabilities involving functions that manipulate DOM attributes are now recognized. |
|
||||
|
||||
## Changes to QL libraries
|
||||
|
||||
* `Expr.getDocumentation()` now handles chain assignments.
|
||||
|
|
|
@ -55,6 +55,14 @@ class ExprOrType extends @exprortype, Documentable {
|
|||
exists(DotExpr dot | this = dot.getProperty() |
|
||||
result = dot.getDocumentation()
|
||||
)
|
||||
or
|
||||
exists(AssignExpr e | this = e.getRhs() |
|
||||
result = e.getDocumentation()
|
||||
)
|
||||
or
|
||||
exists(ParExpr p | this = p.getExpression() |
|
||||
result = p.getDocumentation()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
| tst.js:4:4:4:9 | @param | @param tag refers to non-existent parameter prameter. |
|
||||
| tst.js:12:4:12:9 | @param | @param tag refers to non-existent parameter sign. |
|
||||
| tst.js:51:4:51:9 | @param | @param tag refers to non-existent parameter opts. |
|
||||
| tst.js:57:4:57:9 | @param | @param tag refers to non-existent parameter opts. |
|
||||
|
|
|
@ -45,4 +45,16 @@ function good3() {
|
|||
lastName = arguments[0];
|
||||
}
|
||||
return firstName + sep + lastName;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {IncomingMessage} opts
|
||||
*/
|
||||
var Cookie = foo.bar = function Cookie(options) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {IncomingMessage} opts
|
||||
*/
|
||||
Cookie2 = foo.bar2 = function Cookie2(options) {
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче