CC: Tweaked

CC: Tweaked

57M Downloads

Improvement of serializeImpl-function

magiczocker10 opened this issue ยท 1 comments

commented

Change the beginning of the serializeImpl-function to the following
grafik

This would allow the user to use the same table within a table without triggering the recursive table errormessage. But a table within it self would still trigger the error.

Without change:
grafik

With change:
grafik

commented

I'm afraid I'm probably not going to change this. I think my stance is that unserialization should return a semantically identical table1 to the original one.

That said, I guess serialize could accept an option table like unserializeJSON does (there's other things we could change too, like an option to specify whether we emit whitespace or not). I'd definitely accept a PR for that.

[1] Well, ignoring metatables. IMO this was a mistake, but can't change it now :).