Module:Protected edit request/active: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
handle metatables right
Jackmcbarn (talk | contribs)
clean up metatables/superclasses
Line 467:
 
function box.new(protectionType, args)
-- In the inheritance system used here, an object's metatable is its class, and a class's metatable is its superclass
local obj = getmetatable(box.superclass).new(protectionType, args)
setmetatable(obj, box)
local boxProtectionLevels = {semi = 'autoconfirmed', template = 'templateeditor', full = 'sysop'}
Line 569 ⟶ 570:
 
return function(superclass, yn, mb)
box.superclass = superclass
yesno = yn
makeMessageBox = mb
return setmetatable(box, { __index = superclass })
end