iterators: several small fixes (#11162)

* fix pairs, mpairs, mitems for cstring for JS backend
* add mutation check for pairs and mpairs for strings and seqs
* change the assertion message - modifying (changing elements) is not
  a problem, changing the length is
This commit is contained in:
Miran 2019-05-04 23:02:50 +02:00 • committed by Andreas Rumpf
commit ce152ed91f
3 changed files with 53 additions and 26 deletions

View file

@ -38,7 +38,7 @@ iterator unitems*[T](a: seq[owned T]): T {.inline.} =
while i < L:
yield a[i]
inc(i)
assert(len(a) == L, "seq modified while iterating over it")
assert(len(a) == L, "the length of the seq changed while iterating over it")
proc newWindow(): owned Window =
proc windraw(self: Widget) =