mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
JS: Accept trivial test changes
This adds Alert annotations for alerts that seem intentional by the test but has not been annotated with 'NOT OK', or the comment was in the wrong place. In a few cases I included 'Source' expectations to make it easier to see what happened. Other 'Source' expectations will be added in bulk a later commit.
This commit is contained in:
@@ -25,8 +25,8 @@ if (args.length > j) {
|
||||
console.log(args[j]);
|
||||
}
|
||||
|
||||
function badContains(a, elt) { // $ Alert - incorrect upper bound
|
||||
for (let i = 0; i <= a.length; ++i)
|
||||
function badContains(a, elt) { // incorrect upper bound
|
||||
for (let i = 0; i <= a.length; ++i) // $ Alert
|
||||
if (a[i] === elt)
|
||||
return true;
|
||||
return false;
|
||||
@@ -43,7 +43,7 @@ function goodContains(a, elt) {
|
||||
// this is arguably OK, but we flag it
|
||||
function same(a, b) {
|
||||
for (var i=0; i < a.length || i < b.length ; ++i)
|
||||
if (i <= a.length && i <= b.length && a[i] !== b[i])
|
||||
if (i <= a.length && i <= b.length && a[i] !== b[i]) // $ Alert
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user