Skip to content

Commit 6d9530b

Browse files
committed
显示key的复杂类型
1 parent 9b1b1bb commit 6d9530b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

emmy_core/emmy_debugger.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,16 +310,13 @@ void Debugger::GetVariable(Variable* variable, lua_State* L, int index, int dept
310310
auto* const v = new Variable();
311311
const auto t = lua_type(L, -2);
312312
v->nameType = t;
313-
if (t == LUA_TSTRING) {
314-
v->name = lua_tostring(L, -2);
315-
}
316-
else if (t == LUA_TNUMBER) {
313+
if (t == LUA_TSTRING || t == LUA_TNUMBER || t == LUA_TBOOLEAN) {
317314
lua_pushvalue(L, -2); // avoid error: "invalid key to 'next'" ???
318315
v->name = lua_tostring(L, -1);
319316
lua_pop(L, 1);
320317
}
321318
else {
322-
v->name = lua_typename(L, t);
319+
v->name = ToPointer(L, -2);
323320
}
324321
GetVariable(v, L, -1, depth - 1);
325322
variable->children.push_back(v);

0 commit comments

Comments
 (0)