JS: Update TaintTracking test

This commit is contained in:
Asger F
2023-10-06 15:12:18 +02:00
parent b5ad36686e
commit 2eff07f476
20 changed files with 598 additions and 157 deletions

View File

@@ -0,0 +1,31 @@
import 'dummy';
function makeObject() {
return {
foo: {
bar: {
baz: source()
}
}
};
}
function test() {
const object = makeObject();
sink(object); // OK
sink(JSON.stringify(object)); // NOT OK
sink(object); // OK
}
function testCapture() {
const object = makeObject();
sink(object); // OK
sink(JSON.stringify(object)); // NOT OK
sink(object); // OK - use-use flow should not see the effects of the implicit read in JSON.stringify
function capture() {
object;
}
}