mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
JS: Add a few more tests
This commit is contained in:
@@ -1,9 +1,26 @@
|
||||
import 'dummy';
|
||||
|
||||
function test() {
|
||||
let taint = source();
|
||||
|
||||
|
||||
sink({ ...taint }); // NOT OK
|
||||
sink({ f: 'hello', ...taint, g: 'world' }); // NOT OK
|
||||
|
||||
sink([ ...taint ]); // NOT OK
|
||||
sink([ 1, 2, ...taint, 3 ]); // NOT OK
|
||||
|
||||
fn1(...['x', taint, 'z']);
|
||||
fn2.apply(undefined, ['x', taint, 'z']);
|
||||
}
|
||||
|
||||
function fn1(x, y, z) {
|
||||
sink(x);
|
||||
sink(y); // NOT OK
|
||||
sink(z);
|
||||
}
|
||||
|
||||
function fn2(x, y, z) {
|
||||
sink(x);
|
||||
sink(y); // NOT OK
|
||||
sink(z);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user