- changed milestone to 3.0.5
- changed version to 3.0.3
- changed title to inext returns nil,nil on missing second parameter
inext returns nil,nil on missing second parameter
Issue #51
open
Take the following script:
table = { 1, 2, [42]=42 }
i,v = inext(table)
print(i, '->', v)
You would expect the output to be 1 -> 1
, since a call to next
with its second parameter being nil
also gives you the initial element from the table. However, the output is nil -> nil
because a missing second parameter will be interpreted as index 0
which is not present in any list. Hence, the second check in MtsTable.getINext
will always cause the function to return nil
in this situation.
Comments (3)
-
reporter -
reporter - changed milestone to 3.0.7
-
reporter - changed status to open
- Log in to comment