Last modified: 2013-08-27 13:49:03 UTC
The function mw.clone is meant to create a deep copy of a value. mw.loadData returns read-only tables, so a deep copy is necessary to modify a table returned from mw.loadData. However, when an attempt is made to clone such a table, a script error occurs: table from mw.loadData is read-only This is obviously not the intended behaviour and it prevents one of the main uses of mw.clone.
(In reply to comment #0) > This is obviously not the intended behaviour Technically it is, sort of. mw.clone clones everything, including the metatable methods making the table read-only. That it does this before it tries to clone all the table members is what is making it fail, but it would fail anyway as soon as you tried to modify the cloned table.