| 133 | |
| 134 | |
| 135 | void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, |
| 136 | StkId res, TMS event) { |
| 137 | if (!luaT_callbinTM(L, p1, p2, res, event)) { |
| 138 | switch (event) { |
| 139 | case TM_CONCAT: |
| 140 | luaG_concaterror(L, p1, p2); |
| 141 | /* call never returns, but to avoid warnings: *//* FALLTHROUGH */ |
| 142 | case TM_BAND: case TM_BOR: case TM_BXOR: |
| 143 | case TM_SHL: case TM_SHR: case TM_BNOT: { |
| 144 | lua_Number dummy; |
| 145 | if (tonumber(p1, &dummy) && tonumber(p2, &dummy)) |
| 146 | luaG_tointerror(L, p1, p2); |
| 147 | else |
| 148 | luaG_opinterror(L, p1, p2, "perform bitwise operation on"); |
| 149 | } |
| 150 | /* calls never return, but to avoid warnings: *//* FALLTHROUGH */ |
| 151 | default: |
| 152 | luaG_opinterror(L, p1, p2, "perform arithmetic on"); |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | |
| 158 | int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, |
no test coverage detected