This project is read-only.
1

Resolved

Table is passed as userdata

description

This code will fail:
dynamic tab = lua("return {a = 1, b = 2, c = 3}");
lua.tab = tab;
lua("print(type(tab))");
lua("for k,v in pairs(tab) do print(k,v) end");
Error message:
[string "chunk"]:1: bad argument #1 to 'pairs' (table expected, got userdata)
Thanks for Kees van Marle for reporting this.

comments

simsmaster wrote Sep 14, 2013 at 10:51 AM

This is caused by tab being a DynamicArray instead of the expected DynamicLuaTable

simsmaster wrote Sep 14, 2013 at 1:54 PM

Fixed in commit 9450545a4bd0

simsmaster wrote Mar 3, 2014 at 10:57 AM

Fixed in changeset 9450545a4bd064e021f2eba1fc69a43d6f60f770