mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
JS: IllegalInvocation regression test
This commit is contained in:
@@ -6,3 +6,4 @@
|
||||
| tst.js:43:1:43:7 | new h() | Illegal invocation of $@ using 'new'. | tst.js:40:1:40:21 | async f ... h() {} | an async function |
|
||||
| tst.js:45:1:45:8 | reflective call | Illegal invocation of $@ as a function. | tst.js:1:9:1:8 | () {} | a constructor |
|
||||
| tst.js:46:1:46:9 | reflective call | Illegal invocation of $@ as a function. | tst.js:1:9:1:8 | () {} | a constructor |
|
||||
| tst.js:50:5:50:8 | fn() | Illegal invocation of $@ as a function. | tst.js:1:9:1:8 | () {} | a constructor |
|
||||
|
||||
@@ -53,4 +53,12 @@ class E {
|
||||
E.call(); // OK
|
||||
E.apply(); // OK
|
||||
|
||||
function invoke(fn) {
|
||||
if (typeof fn === "function" && fn.hasOwnProperty("foo")) {
|
||||
fn(); // OK
|
||||
}
|
||||
}
|
||||
invoke(C);
|
||||
invoke(function() {});
|
||||
|
||||
//semmle-extractor-options: --experimental
|
||||
|
||||
Reference in New Issue
Block a user