aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-12-30 16:27:03 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-12-30 16:27:03 -0200
commit5cafe5af02bfe2188ba0b69f5a7a8fe44c38ed24 (patch)
tree12c614ebb45be8ab24be894d83b65ac5e38d8cee /lapi.c
parent607012ece156112f9c45620ce130699f5448db63 (diff)
downloadlua-5cafe5af02bfe2188ba0b69f5a7a8fe44c38ed24.tar.gz
lua-5cafe5af02bfe2188ba0b69f5a7a8fe44c38ed24.tar.bz2
lua-5cafe5af02bfe2188ba0b69f5a7a8fe44c38ed24.zip
tag method must be a function
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lapi.c b/lapi.c
index 75e1c656..8f67b3cd 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.65 1999/12/23 18:19:57 roberto Exp roberto $ 2** $Id: lapi.c,v 1.66 1999/12/27 17:33:22 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -119,8 +119,12 @@ lua_Object lua_gettagmethod (lua_State *L, int tag, const char *event) {
119 119
120 120
121lua_Object lua_settagmethod (lua_State *L, int tag, const char *event) { 121lua_Object lua_settagmethod (lua_State *L, int tag, const char *event) {
122 TObject *method;
122 luaA_checkCparams(L, 1); 123 luaA_checkCparams(L, 1);
123 luaT_settagmethod(L, tag, event, L->top-1); 124 method = L->top-1;
125 if ((ttype(method) != LUA_T_NIL) && (*lua_type(L, method) != 'f'))
126 lua_error(L, "API error - tag method must be a function or nil");
127 luaT_settagmethod(L, tag, event, method);
124 return luaA_putObjectOnTop(L); 128 return luaA_putObjectOnTop(L);
125} 129}
126 130