mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
JS: Add test
This commit is contained in:
@@ -2,4 +2,5 @@ spuriousCallee
|
||||
missingCallee
|
||||
| constructor-field.ts:40:5:40:14 | f3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 |
|
||||
| constructor-field.ts:71:1:71:11 | bf3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 |
|
||||
| returned-function.js:23:1:23:4 | r2() | returned-function.js:8:9:10:9 | functio ... } | -1 |
|
||||
badAnnotation
|
||||
|
||||
@@ -66,7 +66,8 @@ query predicate missingCallee(AnnotatedCall call, AnnotatedFunction target, int
|
||||
|
||||
query predicate badAnnotation(string name) {
|
||||
name = any(AnnotatedCall cl).getCallTargetName() and
|
||||
not name = any(AnnotatedFunction cl).getCalleeName()
|
||||
not name = any(AnnotatedFunction cl).getCalleeName() and
|
||||
name != "NONE"
|
||||
or
|
||||
not name = any(AnnotatedCall cl).getCallTargetName() and
|
||||
name = any(AnnotatedFunction cl).getCalleeName()
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import 'dummy';
|
||||
|
||||
/** name:curry1 */
|
||||
function curry1() {
|
||||
/** name:curry2 */
|
||||
function curry2(x) {
|
||||
/** name:curry3 */
|
||||
function curry3(y) {
|
||||
|
||||
}
|
||||
return curry3;
|
||||
}
|
||||
return curry2;
|
||||
};
|
||||
|
||||
/** calls:curry1 */
|
||||
let r1 = curry1();
|
||||
|
||||
/** calls:curry2 */
|
||||
let r2 = r1();
|
||||
|
||||
/** calls:curry3 */
|
||||
r2();
|
||||
|
||||
function callback(f) {
|
||||
// Call graph should not include callback invocations.
|
||||
/** calls:NONE */
|
||||
f();
|
||||
}
|
||||
|
||||
let w1 = callback(curry1);
|
||||
callback(() => {});
|
||||
Reference in New Issue
Block a user