alibaba / wax

Wax is a framework that lets you write native iPhone apps in Lua.
http://github.com/probablycorey/wax
MIT License
1.84k stars 280 forks source link

Cannot see errors in lua file when using Wax in Swift #57

Open lsoaresesilva opened 7 years ago

lsoaresesilva commented 7 years ago

wax_runLuaFile does not print any error found on lua script. I' have made a change in the source to look like this:

int wax_runLuaFile(const char *script){ [wax_globalLock() lock]; int i = luaL_dofile(wax_currentLuaState(), script); if( i != 0 ) fprintf(stderr,"Error opening wax scripts: %s\n", lua_tostring(wax_currentLuaState(),-1)); [wax_globalLock() unlock]; return i; }

and now I can see the errors.

dourgulf commented 7 years ago

Yes, I think it's necessary to print the error, not only this function but also other 2 wax_runXXX function.