Skip to content

Commit 27e7c86

Browse files
committed
support _ENV
1 parent cafd9d6 commit 27e7c86

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

emmy_core/emmy_debugger.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,16 @@ int EnvIndexFunction(lua_State* L) {
550550
return 1;
551551
}
552552
lua_pop(L, 1);
553+
// _ENV
554+
lua_getfield(L, upvalues, "_ENV");
555+
if (lua_istable(L, -1)) {
556+
lua_getfield(L, -1, name); // _ENV[name]
557+
if (lua_isnil(L, -1) == 0) {
558+
return 1;
559+
}
560+
lua_pop(L, 1);
561+
}
562+
lua_pop(L, 1);
553563
// local value
554564
lua_getfield(L, locals, name);
555565
if (lua_isnil(L, -1) == 0) {

0 commit comments

Comments
 (0)