From 39cdbce23edfd443699e396900a70de3fcff46c7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 25 Aug 2005 12:39:16 -0300 Subject: no more '-w' option + new way to check module existence --- lua.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'lua.c') diff --git a/lua.c b/lua.c index b25e1c1f..40da9b16 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.145 2005/06/03 20:16:16 roberto Exp roberto $ +** $Id: lua.c,v 1.146 2005/06/28 13:01:50 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -48,7 +48,6 @@ static void print_usage (void) { " -i enter interactive mode after executing " LUA_QL("script") "\n" " -l name require library " LUA_QL("name") "\n" " -v show version information\n" - " -w trap access to undefined globals\n" " -- stop handling options\n" , progname); } @@ -223,14 +222,6 @@ static void dotty (lua_State *L) { } -static int checkvar (lua_State *L) { - const char *name = lua_tostring(L, 2); - if (name) - luaL_error(L, "attempt to access undefined variable " LUA_QS, name); - return 0; -} - - #define clearinteractive(i) (*i &= 2) static int handle_argv (lua_State *L, int argc, char **argv, int *interactive) { @@ -268,13 +259,6 @@ static int handle_argv (lua_State *L, int argc, char **argv, int *interactive) { print_version(); break; } - case 'w': { - if (lua_getmetatable(L, LUA_GLOBALSINDEX)) { - lua_pushcfunction(L, checkvar); - lua_setfield(L, -2, "__index"); - } - break; - } case 'e': { const char *chunk = argv[i] + 2; clearinteractive(interactive); -- cgit v1.2.3-55-g6feb