mirror of
https://github.com/lua/lua.git
synced 2024-11-27 20:23:55 +08:00
extra options in 'testC' for newmetatable and testudata
This commit is contained in:
parent
5fa55df2ca
commit
92a0d4c67f
9
ltests.c
9
ltests.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltests.c,v 2.47 2008/02/19 18:55:09 roberto Exp roberto $
|
||||
** $Id: ltests.c,v 2.48 2008/04/02 17:38:54 roberto Exp roberto $
|
||||
** Internal Module for Debugging of the Lua Implementation
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -1010,6 +1010,13 @@ static int testC (lua_State *L) {
|
||||
if (!lua_checkstack(L1, getnum))
|
||||
luaL_error(L, "C stack overflow");
|
||||
}
|
||||
else if EQ("newmetatable") {
|
||||
lua_pushboolean(L1, luaL_newmetatable(L1, getname));
|
||||
}
|
||||
else if EQ("testudata") {
|
||||
int i = getindex;
|
||||
lua_pushboolean(L1, luaL_testudata(L1, i, getname) != NULL);
|
||||
}
|
||||
else if EQ("throw") {
|
||||
#if defined(__cplusplus)
|
||||
static struct X { int x; } x;
|
||||
|
Loading…
Reference in New Issue
Block a user