Module:Sandbox/Artoria2e5/Fallback: Difference between revisions

Content deleted Content added
Implement loop protection
make sure we clear the sad memory in "all the way nil" case
Line 9:
-- Forget about thread-safety.
local referencedKeys = {} -- dataType:Set/hashtable-impl
local attemptDepth = 0 -- useful for "last nil" case
-- Start the new metatable as a copy of the old metatable.
Line 35 ⟶ 36:
end
attemptDepth = attemptDepth + 1
-- Now try use the aliases given.
for _, v in ipairs(arg_aliases[k] or {}) do
Line 43 ⟶ 45:
return t[v]
end
end
attemptDepth = attemptDepth - 1
if attemptDepth == 0 then
referencedKeys = {}
end
return nil