json-related refactor

This commit is contained in:
MihailRis
2024-05-20 03:06:26 +03:00
parent 45862269e7
commit 7fdacffe53
7 changed files with 30 additions and 35 deletions
+1 -4
View File
@@ -25,10 +25,7 @@ static int l_json_stringify(lua_State* L) {
static int l_json_parse(lua_State* L) {
auto string = lua_tostring(L, 1);
auto element = json::parse("<string>", string);
auto value = std::make_unique<dynamic::Value>(
dynamic::Map_sptr(element.release())
);
scripting::state->pushvalue(*value);
scripting::state->pushvalue(element);
return 1;
}