Anonymous user
Module:IP: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
prevent altering of isSubnetObject by using __metatable with a unique key
(use getmetatable to implement isSubnetObject) |
(prevent altering of isSubnetObject by using __metatable with a unique key) |
||
Line 496:
do
local uniqueKey = {}
-- Metatable
local mt = {
Line 504 ⟶ 506:
return self:getCIDR()
end,
__metatable = uniqueKey
}
-- Private static methods
local function isSubnetObject(val)
return getmetatable(val) ==
end
|