aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-08 13:55:52 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-08 13:55:52 -0300
commit1124cb12474b4398384bdefbf12a0769521e17bb (patch)
tree3467e74b2628626204cc094e154a3e437a79f32e /lapi.c
parentc2951478741efaddd34f468fe33a40a786371a3a (diff)
downloadlua-1124cb12474b4398384bdefbf12a0769521e17bb.tar.gz
lua-1124cb12474b4398384bdefbf12a0769521e17bb.tar.bz2
lua-1124cb12474b4398384bdefbf12a0769521e17bb.zip
first step towards _ENV: all chunks have an puvalues _ENV with the
global table
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 17014d47..b1439d1e 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.112 2010/01/21 16:49:21 roberto Exp roberto $ 2** $Id: lapi.c,v 2.113 2010/02/09 11:55:37 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -882,6 +882,12 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
882 if (!chunkname) chunkname = "?"; 882 if (!chunkname) chunkname = "?";
883 luaZ_init(L, &z, reader, data); 883 luaZ_init(L, &z, reader, data);
884 status = luaD_protectedparser(L, &z, chunkname); 884 status = luaD_protectedparser(L, &z, chunkname);
885 if (status == LUA_OK) {
886 Closure *f = clvalue(L->top - 1);
887 lua_assert(!f->c.isC);
888 if (f->l.nupvalues == 1)
889 sethvalue(L, f->l.upvals[0]->v, G(L)->l_gt);
890 }
885 lua_unlock(L); 891 lua_unlock(L);
886 return status; 892 return status;
887} 893}