JS: add comment about arrays

This commit is contained in:
Asger F
2018-11-30 11:33:27 +00:00
parent 374f7ab65d
commit 1130d0c6f9

View File

@@ -99,7 +99,10 @@ predicate isDerivedFromLength(DataFlow::Node length, DataFlow::Node operand) {
}
/**
* An equality comparison of form `A.indexOf(B) === A.length - B.length` or similar.
* An equality comparison of form `A.indexOf(B) === A.length - B.length` or similar.
*
* We assume A and B are strings, even A and/or B could be also be arrays.
* The comparison with the length rarely occurs for arrays, however.
*/
class UnsafeIndexOfComparison extends EqualityTest {
IndexOfCall indexOf;