| 306 | } |
| 307 | |
| 308 | bool CtrlrLuaManager::runCode (const String &code, const String name) |
| 309 | { |
| 310 | if (luaState && !isLuaDisabled()) |
| 311 | { |
| 312 | if (luaL_loadbuffer(luaState, code.toUTF8(), std::strlen(code.toUTF8()), name.isEmpty() ? "_runtime" : name.toUTF8()) |
| 313 | || lua_pcall(luaState, 0, 0, 0)) |
| 314 | { |
| 315 | const char* a = lua_tostring(luaState, -1); |
| 316 | _LERR("ERROR: " + String(a)); |
| 317 | lastError = "ERROR: " + String(a); |
| 318 | lua_pop(luaState, 1); |
| 319 | return (false); |
| 320 | } |
| 321 | |
| 322 | return (true); |
| 323 | } |
| 324 | else |
| 325 | { |
| 326 | return (false); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | void CtrlrLuaManager::log(const String &message) |
| 331 | { |
no test coverage detected