Kaynağa Gözat

detail: registry._PRELOAD must be a table, no need to check

Roberto Ierusalimschy 15 yıl önce
ebeveyn
işleme
fd4b4a2a68
1 değiştirilmiş dosya ile 1 ekleme ve 3 silme
  1. 1 3
      loadlib.c

+ 1 - 3
loadlib.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: loadlib.c,v 1.88 2010/07/25 15:03:37 roberto Exp roberto $
+** $Id: loadlib.c,v 1.89 2010/07/28 15:51:59 roberto Exp roberto $
 ** Dynamic library loader for Lua
 ** Dynamic library loader for Lua
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 **
 **
@@ -428,8 +428,6 @@ static int loader_Croot (lua_State *L) {
 static int loader_preload (lua_State *L) {
 static int loader_preload (lua_State *L) {
   const char *name = luaL_checkstring(L, 1);
   const char *name = luaL_checkstring(L, 1);
   lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD");
   lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD");
-  if (!lua_istable(L, -1))
-    luaL_error(L, LUA_QL("package.preload") " must be a table");
   lua_getfield(L, -1, name);
   lua_getfield(L, -1, name);
   if (lua_isnil(L, -1))  /* not found? */
   if (lua_isnil(L, -1))  /* not found? */
     lua_pushfstring(L, "\n\tno field package.preload['%s']", name);
     lua_pushfstring(L, "\n\tno field package.preload['%s']", name);