Skip to content

Commit 54a0e6d

Browse files
committed
JS: Add new test for Array.splice
1 parent 9ed6da1 commit 54a0e6d

File tree

2 files changed

+135
-54
lines changed

2 files changed

+135
-54
lines changed

javascript/ql/test/library-tests/Arrays/arrays.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
arr4.splice(0, 0, "source");
3030
sink(arr4.pop()); // NOT OK
3131

32-
// var arr4_variant = [];
33-
// arr4_variant.splice(0, 0, "safe", "source");
34-
// arr4_variant.pop();
35-
// sink(arr4_variant.pop()); // NOT OK
32+
var arr4_variant = [];
33+
arr4_variant.splice(0, 0, "safe", "source");
34+
arr4_variant.pop();
35+
sink(arr4_variant.pop()); // NOT OK
3636

3737
var arr5 = [].concat(arr4);
3838
sink(arr5.pop()); // NOT OK
@@ -51,7 +51,7 @@
5151
sink(ary); // OK - its the array itself, not an element.
5252
});
5353

54-
sink(arr[0]); // OK - tuple like usage.
54+
sink(arr[0]); // OK - tuple like usage.
5555

5656
for (const x of arr) {
5757
sink(x); // NOT OK
@@ -64,7 +64,7 @@
6464
for (const x of [...arr]) {
6565
sink(x); // NOT OK
6666
}
67-
67+
6868
var arr7 = [];
6969
arr7.push(...arr);
7070
for (const x of arr7) {

0 commit comments

Comments
 (0)