Closed timstableford closed 3 years ago
After that commit I'm having this error when trying to decorate a object with both reference and metatable:
Error: data already has associated metatable
I'm testing it in demoon project
@ceifa That's correct. Because the user data already has an associated metatable to do the GC if the user tries to set a metatable on it then that would overwrite the existing one, disabling the GC
For cases where you need a reference and a metatable you could have an outer-table that contains the reference to the GC'd JS object along along with the methods? It may be possible to have that as the default for the userdata type? I can put together a demo/test if you like? Though knowing you you've probably already done it :)
Idk if I understood it well, a demo would be very nice! I was thinking in merge the metatables, but idk if it's a good solution too.