mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
JS: Expand callback test case
Type-based pruning is confused by the different tests being interleaved, so we additionally want to have a test that is independent from the other parts of this test.
This commit is contained in:
@@ -58,3 +58,18 @@ function test() {
|
||||
sink(x); // NOT OK
|
||||
});
|
||||
}
|
||||
|
||||
function forwardTaint3(x, cb) {
|
||||
cb(x); // Same as 'forwardTaint' but copied to avoid interference between tests
|
||||
cb(x);
|
||||
}
|
||||
|
||||
function forwardTaint4(x, cb) {
|
||||
forwardTaint3(x, cb); // Same as 'forwardTaint2' but copied to avoid interference between tests
|
||||
forwardTaint3(x, cb);
|
||||
}
|
||||
|
||||
function test2() {
|
||||
forwardTaint4(source(), x => sink(x)); // NOT OK
|
||||
forwardTaint4("safe", x => sink(x)); // OK [INCONSISTENCY]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user