Closed aldus2 closed 6 years ago
It's a feature; it's not possible to return table literal that includes shared or self-references, so the serializer replaces them with nil
values and adds a comment to indicate that this is the case. You can use .dump
method instead of .line
, which is more verbose, but doesn't have this issue.
I thought there was a problem with lua but in fact, everything works fine, it is only a question of wrong display of the console or of the in situ comments. Here is an example :
In the console in response to the question : arrFunc the answer : {function() --[[..skipped..]] end --[[function: 0x1371060]], nil --[[ref]]} --[[table: 0x1371150]] --[[incomplete output with shared/self-references skipped]] "nil" is incorrect. print(type(arrFunc[2]) gives "function" (rather strange for a nil) Moreover arrFunc2 gives 30 (again not in line with a "nil") but shows that it is working fine in lua.
The same phenomenon is true for another type of reference as a table, as in :
Version : 1.7 ; MobDebug 0.702 OS : Ubuntu LTS 14.04