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:
Asger F
2023-10-10 14:35:26 +02:00
parent d3f5169e66
commit e738b5d125
3 changed files with 21 additions and 0 deletions

View File

@@ -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]
}