mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Add new experimental query MultipleArgumentsToSetConstructor.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
| MultipleArgumentsToSetConstructorBad.js:1:29:1:31 | 'e' | All but the first argument to the Set constructor are ignored. |
|
||||
| MultipleArgumentsToSetConstructorBad.js:1:34:1:36 | 'i' | All but the first argument to the Set constructor are ignored. |
|
||||
| MultipleArgumentsToSetConstructorBad.js:1:39:1:41 | 'o' | All but the first argument to the Set constructor are ignored. |
|
||||
| MultipleArgumentsToSetConstructorBad.js:1:44:1:46 | 'u' | All but the first argument to the Set constructor are ignored. |
|
||||
| tst.js:3:12:3:13 | xs | All but the first argument to the Set constructor are ignored. |
|
||||
| tst.js:3:19:3:20 | ys | All but the first argument to the Set constructor are ignored. |
|
||||
@@ -0,0 +1 @@
|
||||
experimental/StandardLibrary/MultipleArgumentsToSetConstructor.ql
|
||||
@@ -0,0 +1,5 @@
|
||||
const vowels = new Set('a', 'e', 'i', 'o', 'u');
|
||||
|
||||
function isVowel(char) {
|
||||
return vowels.has(char.toLowerCase());
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
const vowels = new Set(['a', 'e', 'i', 'o', 'u']);
|
||||
|
||||
function isVowel(char) {
|
||||
return vowels.has(char.toLowerCase());
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
let xs = [1, 2, 3];
|
||||
let ys = [4, 5, 6];
|
||||
new Set(...xs, ...ys); // NOT OK
|
||||
new Set([...xs, ...ys]); // OK
|
||||
new Set(xs); // OK
|
||||
new Set(); // OK
|
||||
Reference in New Issue
Block a user