diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-10 14:30:59 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-10 14:30:59 -0200 |
commit | e791f025c0c59b0a428fab604a7e2251cca568f5 (patch) | |
tree | deb5ce4cccee88d6738b90ce162e5a6f2091d6af | |
parent | f61d435a7d34a07c2edd51714ad6072916e40092 (diff) | |
download | lua-e791f025c0c59b0a428fab604a7e2251cca568f5.tar.gz lua-e791f025c0c59b0a428fab604a7e2251cca568f5.tar.bz2 lua-e791f025c0c59b0a428fab604a7e2251cca568f5.zip |
no more `_TRACEBACK' variable
-rw-r--r-- | ldblib.c | 4 | ||||
-rw-r--r-- | lua.c | 7 |
2 files changed, 4 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.88 2004/09/21 17:58:06 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.89 2004/11/17 12:02:41 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -338,8 +338,6 @@ static const luaL_reg dblib[] = { | |||
338 | 338 | ||
339 | LUALIB_API int luaopen_debug (lua_State *L) { | 339 | LUALIB_API int luaopen_debug (lua_State *L) { |
340 | luaL_openlib(L, LUA_DBLIBNAME, dblib, 0); | 340 | luaL_openlib(L, LUA_DBLIBNAME, dblib, 0); |
341 | lua_pushcfunction(L, errorfb); | ||
342 | lua_setglobal(L, "_TRACEBACK"); | ||
343 | return 1; | 341 | return 1; |
344 | } | 342 | } |
345 | 343 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.132 2004/08/30 18:35:14 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.133 2004/11/18 19:53:49 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -82,8 +82,7 @@ static int report (lua_State *L, int status) { | |||
82 | static int docall (lua_State *L, int narg, int clear) { | 82 | static int docall (lua_State *L, int narg, int clear) { |
83 | int status; | 83 | int status; |
84 | int base = lua_gettop(L) - narg; /* function index */ | 84 | int base = lua_gettop(L) - narg; /* function index */ |
85 | lua_pushliteral(L, "_TRACEBACK"); | 85 | luaL_getfield(L, LUA_GLOBALSINDEX, "debug.traceback"); |
86 | lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */ | ||
87 | lua_insert(L, base); /* put it under chunk and args */ | 86 | lua_insert(L, base); /* put it under chunk and args */ |
88 | signal(SIGINT, laction); | 87 | signal(SIGINT, laction); |
89 | status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); | 88 | status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); |
@@ -359,7 +358,7 @@ static int pmain (lua_State *L) { | |||
359 | int interactive = 1; | 358 | int interactive = 1; |
360 | if (s->argv[0] && s->argv[0][0]) progname = s->argv[0]; | 359 | if (s->argv[0] && s->argv[0][0]) progname = s->argv[0]; |
361 | globalL = L; | 360 | globalL = L; |
362 | lua_userinit(L); /* open libraries */ | 361 | luaopen_stdlibs(L); /* open libraries */ |
363 | status = handle_luainit(L); | 362 | status = handle_luainit(L); |
364 | if (status == 0) { | 363 | if (status == 0) { |
365 | status = handle_argv(L, s->argv, &interactive); | 364 | status = handle_argv(L, s->argv, &interactive); |