LuaInterface: Disable auto table unpacking for vargs. Lua 5.1 does not have such a feature. print({1, 2, 3}) should pass just an array, not multiple arguments.
This commit is contained in:
parent
b0970451aa
commit
acc124ca99
|
@ -758,6 +758,10 @@ namespace LuaInterface
|
||||||
|
|
||||||
var luaParamValue = luaParamValueExtractor (startIndex);
|
var luaParamValue = luaParamValueExtractor (startIndex);
|
||||||
|
|
||||||
|
#if false
|
||||||
|
// LuaTable unpacking is disabled.
|
||||||
|
// In Lua, print({1, 2, 3}) should pass an array, not multiple arguments.
|
||||||
|
// You can write print(unpack({1, 2, 3})) if necessary.
|
||||||
if (luaParamValue is LuaTable) {
|
if (luaParamValue is LuaTable) {
|
||||||
LuaTable table = (LuaTable)luaParamValue;
|
LuaTable table = (LuaTable)luaParamValue;
|
||||||
IDictionaryEnumerator tableEnumerator = table.GetEnumerator ();
|
IDictionaryEnumerator tableEnumerator = table.GetEnumerator ();
|
||||||
|
@ -777,8 +781,10 @@ namespace LuaInterface
|
||||||
paramArray.SetValue (Convert.ChangeType (value, paramArrayType), paramArrayIndex);
|
paramArray.SetValue (Convert.ChangeType (value, paramArrayType), paramArrayIndex);
|
||||||
paramArrayIndex++;
|
paramArrayIndex++;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
paramArray = Array.CreateInstance (paramArrayType, count);
|
paramArray = Array.CreateInstance (paramArrayType, count);
|
||||||
|
|
||||||
paramArray.SetValue (luaParamValue, 0);
|
paramArray.SetValue (luaParamValue, 0);
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue