* @brief Pushes a QJsonArray onto the Lua stack as a 1-indexed sequence. */
| 369 | * @brief Pushes a QJsonArray onto the Lua stack as a 1-indexed sequence. |
| 370 | */ |
| 371 | static void jsonArrayToLua(lua_State* L, const QJsonArray& arr, int depth) |
| 372 | { |
| 373 | lua_createtable(L, arr.size(), 0); |
| 374 | if (depth >= kMaxJsonDepth) |
| 375 | return; |
| 376 | |
| 377 | int i = 1; |
| 378 | for (const auto& v : arr) { |
| 379 | jsonValueToLua(L, v, depth + 1); |
| 380 | lua_rawseti(L, -2, i++); |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * @brief Pushes any QJsonValue onto the Lua stack; null becomes nil. |
no test coverage detected