-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow table.clone to copy tables with locked metatables #88
base: master
Are you sure you want to change the base?
Conversation
Would it be intuitive for a metatable to only sometimes be copied? |
Yes |
I haven't finished this yet because I haven't resolved 2 of the issues levied yet. |
Done |
I don't fully understand the motivation here. Why would JSONEncode need to clone the table, as opposed to using rawget et al? Why would you want to JSON serialize something with a locked metatable? The downside is that this RFC proposes changing
One alternative I could see that is perhaps more sensible is But beyond everything else I think this RFC needs a use case that is actually clear and not adequately solved today. |
Does default Lua allow table.copy to copy with metatables, shouldn't it be an optional thing that can be copied? |
Lua doesn't have |
Luau doesn't have
but the first table inputted into
Regarding
Was there ever a reason why |
From a cursory glimpse at this RFC, would this not be a sandboxing hazard if table.clone'd tables shadow cloned the table and then simply dropped the metatable? |
Allow
table.clone
to copy tables with locked metatables.Rendered
This is a remake of the original poorly done RFC #73 . The issues in the original RFC have been fixed and the ambiguities have been clarified.