mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +00:00
Fix return of super.static if val false (fix #50)
This commit is contained in:
parent
27a64f107e
commit
6b4bc410d6
@ -79,7 +79,15 @@ local function _createClass(name, super)
|
|||||||
subclasses = setmetatable({}, {__mode='k'}) }
|
subclasses = setmetatable({}, {__mode='k'}) }
|
||||||
|
|
||||||
if super then
|
if super then
|
||||||
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) or super.static[k] end })
|
setmetatable(aClass.static, {
|
||||||
|
__index = function(_,k)
|
||||||
|
local result = rawget(dict,k)
|
||||||
|
if result == nil {
|
||||||
|
return super.static[k]
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
})
|
||||||
else
|
else
|
||||||
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) end })
|
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) end })
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user