mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +00:00
Merge pull request #51 from qaisjp/patch-1
Fix return of super.static if val false (fix #50)
This commit is contained in:
commit
f9955f9285
@ -79,7 +79,15 @@ local function _createClass(name, super)
|
||||
subclasses = setmetatable({}, {__mode='k'}) }
|
||||
|
||||
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 then
|
||||
return super.static[k]
|
||||
end
|
||||
return result
|
||||
end
|
||||
})
|
||||
else
|
||||
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) end })
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user