Skip to content

Commit 7250099

Browse files
committed
JS: Add: Test cases use of returnless function in findLast and findLastIndex
1 parent fcb6553 commit 7250099

File tree

1 file changed

+10
-0
lines changed
  • javascript/ql/test/query-tests/Statements/UseOfReturnlessFunction

1 file changed

+10
-0
lines changed

javascript/ql/test/query-tests/Statements/UseOfReturnlessFunction/tst.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,13 @@ class Bar extends Foo {
107107
console.log(super()); // OK.
108108
}
109109
}
110+
111+
() => {
112+
let equals = (x, y) => { return x === y; };
113+
114+
var foo = [1,2,3].findLastIndex(n => { equals(n, 3); }) // NOT OK -- Currently not flagged, but should be.
115+
console.log(foo);
116+
117+
var foo = [1,2,3].findLast(n => { equals(n, 3); }) // NOT OK -- Currently not flagged, but should be.
118+
console.log(foo);
119+
}

0 commit comments

Comments
 (0)