Skip to content

Commit 8512cb4

Browse files
committed
JS: Add: Test cases for toSpliced with spread operator
1 parent cf90430 commit 8512cb4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

javascript/ql/test/library-tests/TaintTracking/array-mutation.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,11 @@ function test(x, y) {
6767
let q = [];
6868
q.splice(x, y, ...source());
6969
sink(q); // NOT OK
70+
71+
let r = [];
72+
let rSpliced = r.toSpliced(x, y, ...source());
73+
sink(rSpliced); // NOT OK -- This should flagged but it is not
74+
sink(r); // OK
75+
r = r.toSpliced(x, y, ...source());
76+
sink(r); // NOT OK -- This should flagged but it is not
7077
}

0 commit comments

Comments
 (0)