From e791f025c0c59b0a428fab604a7e2251cca568f5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 10 Jan 2005 14:30:59 -0200 Subject: [PATCH] no more `_TRACEBACK' variable --- ldblib.c | 4 +--- lua.c | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ldblib.c b/ldblib.c index cac06e77..244b24d0 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.88 2004/09/21 17:58:06 roberto Exp roberto $ +** $Id: ldblib.c,v 1.89 2004/11/17 12:02:41 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -338,8 +338,6 @@ static const luaL_reg dblib[] = { LUALIB_API int luaopen_debug (lua_State *L) { luaL_openlib(L, LUA_DBLIBNAME, dblib, 0); - lua_pushcfunction(L, errorfb); - lua_setglobal(L, "_TRACEBACK"); return 1; } diff --git a/lua.c b/lua.c index 5e4ca9fb..e316e9c4 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.132 2004/08/30 18:35:14 roberto Exp roberto $ +** $Id: lua.c,v 1.133 2004/11/18 19:53:49 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -82,8 +82,7 @@ static int report (lua_State *L, int status) { static int docall (lua_State *L, int narg, int clear) { int status; int base = lua_gettop(L) - narg; /* function index */ - lua_pushliteral(L, "_TRACEBACK"); - lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */ + luaL_getfield(L, LUA_GLOBALSINDEX, "debug.traceback"); lua_insert(L, base); /* put it under chunk and args */ signal(SIGINT, laction); status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); @@ -359,7 +358,7 @@ static int pmain (lua_State *L) { int interactive = 1; if (s->argv[0] && s->argv[0][0]) progname = s->argv[0]; globalL = L; - lua_userinit(L); /* open libraries */ + luaopen_stdlibs(L); /* open libraries */ status = handle_luainit(L); if (status == 0) { status = handle_argv(L, s->argv, &interactive);