JS: address comments

This commit is contained in:
Asger F
2019-01-02 11:12:52 +00:00
parent f9d7f8ba11
commit 8c3b44a525
3 changed files with 6 additions and 6 deletions

View File

@@ -5,7 +5,7 @@
<overview>
<p>
Items can be removed from an array using the <code>splice</code> method, but when doing so,
all subseequent items will be shifted to a lower index. If this is done while iterating over
all subsequent items will be shifted to a lower index. If this is done while iterating over
the array, the shifting may cause the loop to skip over the element immediately after the
removed element.
</p>

View File

@@ -11,7 +11,7 @@
import javascript
/**
* Operation that inserts or removes elements from an array while shifting all elements
* An operation that inserts or removes elements from an array while shifting all elements
* occuring after the insertion/removal point.
*
* Does not include `push` and `pop` since these never shift any elements.
@@ -160,4 +160,4 @@ class ArrayIterationLoop extends ForStmt {
from ArrayIterationLoop loop, SpliceCall splice
where loop.hasPathThrough(splice, loop.getUpdate().getFirstControlFlowNode())
select splice, "Missing loop index adjustment after removing array item. Some array items will be skipped due to shifting."
select splice, "Removing an array item without adjusting the loop index '" + loop.getIndexVariable().getName() + "' causes the subsequent array item to be skipped."