diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.57 2001/01/18 15:59:09 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.58 2001/01/19 13:20:30 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -270,8 +270,19 @@ static int udataval (lua_State *L) { | |||
270 | return 1; | 270 | return 1; |
271 | } | 271 | } |
272 | 272 | ||
273 | |||
274 | static int doonnewstack (lua_State *L) { | ||
275 | lua_State *L1 = lua_open(L, luaL_check_int(L, 1)); | ||
276 | if (L1 == NULL) return 0; | ||
277 | lua_dostring(L1, luaL_check_string(L, 2)); | ||
278 | lua_pushnumber(L, 1); | ||
279 | lua_close(L1); | ||
280 | return 1; | ||
281 | } | ||
282 | |||
283 | |||
273 | static int newstate (lua_State *L) { | 284 | static int newstate (lua_State *L) { |
274 | lua_State *L1 = lua_open(luaL_check_int(L, 1)); | 285 | lua_State *L1 = lua_open(NULL, luaL_check_int(L, 1)); |
275 | if (L1) | 286 | if (L1) |
276 | lua_pushuserdata(L, L1); | 287 | lua_pushuserdata(L, L1); |
277 | else | 288 | else |
@@ -518,6 +529,7 @@ static const struct luaL_reg tests_funcs[] = { | |||
518 | {"unref", unref}, | 529 | {"unref", unref}, |
519 | {"newuserdata", newuserdata}, | 530 | {"newuserdata", newuserdata}, |
520 | {"udataval", udataval}, | 531 | {"udataval", udataval}, |
532 | {"doonnewstack", doonnewstack}, | ||
521 | {"newstate", newstate}, | 533 | {"newstate", newstate}, |
522 | {"closestate", closestate}, | 534 | {"closestate", closestate}, |
523 | {"doremote", doremote}, | 535 | {"doremote", doremote}, |