multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.38k stars 427 forks source link

toJSON fail to serialize json containing two references to same table #3743

Open CrosRoad95 opened 1 week ago

CrosRoad95 commented 1 week ago

Describe the bug

local a = {1}
iprint(toJSON({a, a})) -- prints:  [ [ [ 1 ], "^T^1" ] ]

Probably "^T^1" trying to say to use known table but in context of toJSON it should not be the same

Steps to reproduce

see above

Version

client & server: Multi Theft Auto v1.6-release-22684

Additional context

i see no changes in toJSON in past 2 months either in commits and in sources

Relevant log output

No response

Security Policy

dmi7ry commented 1 week ago

I would like to see an option to disable such "optimisation" at all.