From 9a3b884affc6317c7e0a72d7e43f2fcb5e6850fd Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Sat, 14 Nov 2009 07:41:39 +0000 Subject: [PATCH] callpush/pop cleanups --- stead/stead.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/stead/stead.lua b/stead/stead.lua index c09e0a1..c50cfa6 100644 --- a/stead/stead.lua +++ b/stead/stead.lua @@ -12,9 +12,9 @@ function cctx() return stead.cctx[stead.call_top]; end -function callpush() +function callpush(v) stead.call_top = stead.call_top + 1; - stead.cctx[stead.call_top] = { txt = nil, self = nil }; + stead.cctx[stead.call_top] = { txt = nil, self = v }; end function callpop() @@ -586,9 +586,7 @@ function call(v, n, ...) return v[n]; end if type(v[n]) == 'function' then - callpush() - pclr() - self(v) + callpush(v) local a,b = v[n](v, unpack(arg)); if a == nil and b == nil then a = pget() @@ -614,9 +612,7 @@ function call_bool(v, n, ...) end if type(v[n]) == 'function' then - callpush() - pclr() - self(v) + callpush(v) local r = v[n](v, unpack(arg)); callpop(); return r;