File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -697,15 +697,14 @@ end
697697-- uses a structured clone algorithm to maintain cyclic references
698698local function copy_table_recursive (t , references , depth )
699699 if type (t ) ~= " table" or depth == 0 then return t end
700- if references [t ] then return references [t ] end
701700
702701 -- bypasses the proxy protecting read-only tables
703702 local mt = getmetatable (t )
704- local original_t
705- if mt and mt . __newindex == newindex then original_t = mt . __index end
703+ if mt and mt . __newindex == readonly_newindex then t = mt . mutable end
704+ if references [ t ] then return references [ t ] end
706705
707706 local copy = setmetatable ({}, { __original = t })
708- references [original_t or t ] = copy
707+ references [t ] = copy
709708
710709 for key , value in pairs (t ) do
711710 key = copy_table_recursive (key , references , depth - 1 )
You can’t perform that action at this time.
0 commit comments