Skip to content

Commit 563f321

Browse files
suggestions from @max-schaefer
Co-Authored-By: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
1 parent 92cebea commit 563f321

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

javascript/ql/src/Statements/IgnoreArrayResult.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<overview>
66
<p>
77
The <code>concat</code>, <code>join</code> and <code>slice</code> methods are
8-
pure and does not modify any of the inputs or the array the method was called
8+
pure and do not modify any of the inputs or the array the method was called
99
on. It is therefore generally an error to ignore the return value from a call
1010
to one of these methods.
1111
</p>

javascript/ql/src/Statements/IgnoreArrayResult.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
* @name Ignoring result from pure array method
3-
* @description The array methods do not modify the array, ignoring the result of such a call is therefore generally an error.
3+
* @description Ignoring the result of an array method that does not modify its receiver is generally an error.
44
* @kind problem
55
* @problem.severity warning
66
* @id js/ignore-array-result
7-
* @tags maintainability,
7+
* @tags maintainability
88
* correctness
99
* @precision high
1010
*/
@@ -16,7 +16,7 @@ DataFlow::SourceNode callsArray(DataFlow::TypeBackTracker t, DataFlow::MethodCal
1616
isIgnoredPureArrayCall(call) and
1717
(
1818
t.start() and
19-
result = call.getReceiver()
19+
result = call.getReceiver().getALocalSource()
2020
or
2121
exists(DataFlow::TypeBackTracker t2 | result = callsArray(t2, call).backtrack(t2, t))
2222
)

0 commit comments

Comments
 (0)