mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
add query for detecting ignored calls to Array.prototype.concat
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
| tst.js:3:1:3:19 | arr.concat([1,2,3]) | Return value from call to concat ignored. |
|
||||
| tst.js:5:1:5:15 | arr.concat(arr) | Return value from call to concat ignored. |
|
||||
@@ -0,0 +1 @@
|
||||
Statements/IgnoreConcatReturn.ql
|
||||
@@ -0,0 +1,13 @@
|
||||
var arr = [1,2,3];
|
||||
|
||||
arr.concat([1,2,3]); // NOT OK!
|
||||
|
||||
arr.concat(arr); // NOT OK!
|
||||
|
||||
console.log(arr.concat([1,2,3]));
|
||||
|
||||
arr.concat(null);
|
||||
arr.concat();
|
||||
arr.concat([]);
|
||||
|
||||
({concat: Array.prototype.concat}.concat(arr));
|
||||
Reference in New Issue
Block a user