** Raise an error for calling a non-callable object. Try to find a name ** for the object based on how it was called ('funcnamefromcall'); if it ** cannot get a name there, try 'varinfo'. */
| 783 | ** cannot get a name there, try 'varinfo'. |
| 784 | */ |
| 785 | l_noret luaG_callerror (lua_State *L, const TValue *o) { |
| 786 | CallInfo *ci = L->ci; |
| 787 | const char *name = NULL; /* to avoid warnings */ |
| 788 | const char *kind = funcnamefromcall(L, ci, &name); |
| 789 | const char *extra = kind ? formatvarinfo(L, kind, name) : varinfo(L, o); |
| 790 | typeerror(L, o, "call", extra); |
| 791 | } |
| 792 | |
| 793 | |
| 794 | l_noret luaG_forerror (lua_State *L, const TValue *o, const char *what) { |
no test coverage detected