Skip to content

Commit 0a00069

Browse files
committed
bug fix #27
1 parent a1fdc12 commit 0a00069

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

emmy_core/emmy_debugger.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ int EnvIndexFunction(lua_State* L) {
570570
return 1;
571571
}
572572
lua_pop(L, 1);
573+
// local value
574+
lua_getfield(L, locals, name);
575+
if (lua_isnil(L, -1) == 0) {
576+
return 1;
577+
}
578+
lua_pop(L, 1);
573579
// _ENV
574580
lua_getfield(L, upvalues, "_ENV");
575581
if (lua_istable(L, -1)) {
@@ -580,12 +586,6 @@ int EnvIndexFunction(lua_State* L) {
580586
lua_pop(L, 1);
581587
}
582588
lua_pop(L, 1);
583-
// local value
584-
lua_getfield(L, locals, name);
585-
if (lua_isnil(L, -1) == 0) {
586-
return 1;
587-
}
588-
lua_pop(L, 1);
589589
// global
590590
lua_getglobal(L, name);
591591
if (lua_isnil(L, -1) == 0) {

0 commit comments

Comments
 (0)