Open
Description
When attempting to modify a parameter by itself works perfectly, however when that parameter is a table, attempting to change the value in that table the value becomes null. I have some examples below:
All are called using this C# code:
object args = new { barcode = "1234567890" };
var resultstr = lua.LuaCall("immutabletest4", args);
Test 1: Here the resultstr is null (Error case!)
function immutabletest(args)
args.barcode = '1234'
return args.barcode
end
Test 2: Here resultstr gets the value "1234567890", as it should
function immutabletest2(args)
barcode = args.barcode or nil
return barcode
end
Test 3: Here resultstr gets the value "1234567890", as it should
function immutabletest3(args)
return args.barcode
end
Test 4: Here resultstr gets the value "1234", as it should. I was testing immutability of parameters, and they aren't.
function immutabletest4(barcode)
barcode = '1234'
return barcode
end
<
4949
div class="CommentDivider-module__CommentDividerContainer--u90jt">
Metadata
Metadata
Assignees
Labels
No labels