2
0
Эх сурвалжийг харах

no more `_TRACEBACK' variable

Roberto Ierusalimschy 20 жил өмнө
parent
commit
e791f025c0
2 өөрчлөгдсөн 4 нэмэгдсэн , 7 устгасан
  1. 1 3
      ldblib.c
  2. 3 4
      lua.c

+ 1 - 3
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;
 }
 

+ 3 - 4
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);