diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/util-sto.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/util-sto.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sto.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sto.lua index 5b6915eaf01..a08d25ced18 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-sto.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-sto.lua @@ -196,6 +196,19 @@ function table.getmetatablekey(t,key,value) return m and m[key] end +function table.makeweak(t) + if not t then + t = { } + end + local m = getmetatable(t) + if m then + m.__mode = "v" + else + setmetatable(t,{ __mode = "v" }) + end + return t +end + -- Problem: we have no __next (which is ok as it would probably slow down lua) so -- we cannot loop over the keys. |