You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding arrays to the environment leads to unexpected behavior:
table.remove will not shift the array
Arrays have a length key when using pairs, however ipairs does not have this issue
constfactory=newLuaFactory()constlua=awaitfactory.createEngine()constenv=lua.globalenv.set("array_test",["a","b","c"])awaitlua.doString(` table.remove(array_test, 2) for k, v in pairs(array_test) do print(k, v) end`)
0 a
1 c
2 nil
length 3
These issues do not happen when creating regular tables
awaitlua.doString(` local table_test = {"a", "b", "c"} table.remove(table_test, 2) for k, v in pairs(table_test) do print(k, v) end`)
1 a
2 c
The text was updated successfully, but these errors were encountered:
Adding arrays to the environment leads to unexpected behavior:
table.remove
will not shift the arraylength
key when usingpairs
, howeveripairs
does not have this issueThese issues do not happen when creating regular tables
The text was updated successfully, but these errors were encountered: