no need to keep "_ENV" name in global state (can be kept in lex state)

This commit is contained in:
Roberto Ierusalimschy
2010-04-05 13:35:37 -03:00
parent d394d5536a
commit 6abde1b05a
5 changed files with 12 additions and 12 deletions

4
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 2.34 2009/11/17 16:33:38 roberto Exp roberto $
** $Id: llex.c,v 2.35 2010/02/27 21:16:24 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -152,6 +152,8 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
ls->linenumber = 1;
ls->lastline = 1;
ls->source = source;
ls->envn = luaS_new(L, "_ENV");
luaS_fix(ls->envn); /* never collect this name */
luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */
next(ls); /* read first char */
}