diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-08 13:55:52 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-08 13:55:52 -0300 |
commit | 1124cb12474b4398384bdefbf12a0769521e17bb (patch) | |
tree | 3467e74b2628626204cc094e154a3e437a79f32e /lapi.c | |
parent | c2951478741efaddd34f468fe33a40a786371a3a (diff) | |
download | lua-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.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 | } |