Allow table.clone to copy tables with locked metatables#88
Allow table.clone to copy tables with locked metatables#88ccuser44 wants to merge 8 commits intoluau-lang:masterfrom
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.cloneto 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.