Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stevedonovan/Penlight.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteve donovan <steve.j.donovan@gmail.com>2011-10-02 21:05:52 +0400
committersteve donovan <steve.j.donovan@gmail.com>2011-10-02 21:05:52 +0400
commit301a843ca3300027493b39d36f707c452a1469cd (patch)
tree72859c7b0f51780b0b022c8b66f43f50be2462b2
parentf230f9fe415f196f4656f466a8e609ea39dcba90 (diff)
rawget needed for base ctor lookup when handler defined
-rw-r--r--lua/pl/class.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/lua/pl/class.lua b/lua/pl/class.lua
index 773623e..5cfbf99 100644
--- a/lua/pl/class.lua
+++ b/lua/pl/class.lua
@@ -2,12 +2,7 @@
-- Two possible notations: <br> <code> B = class(A) </code> or <code> class.B(A) </code>. <br>
-- <p>The latter form creates a named class. </p>
-- See the Guide for further <a href="../../index.html#class">discussion</a>
--- @class module
--- @name pl.class
-
---[[
-module ('pl.class')
-]]
+-- @module pl.class
local error, getmetatable, io, pairs, rawget, rawset, setmetatable, tostring, type =
_G.error, _G.getmetatable, _G.io, _G.pairs, _G.rawget, _G.rawset, _G.setmetatable, _G.tostring, _G.type
@@ -15,7 +10,8 @@ local error, getmetatable, io, pairs, rawget, rawset, setmetatable, tostring, ty
-- the resulting recursive call problems.
local function call_ctor (c,obj,...)
-- nice alias for the base class ctor
- if rawget(c,'_base') then obj.super = c._base._init end
+ local base = rawget(c,'_base')
+ if base then obj.super = rawget(base,'_init') end
local res = c._init(obj,...)
obj.super = nil
return res