| 302 | } |
| 303 | |
| 304 | LUABIND_API object_rep* get_instance(lua_State* L, int index) |
| 305 | { |
| 306 | object_rep* result = static_cast<object_rep*>(lua_touserdata(L, index)); |
| 307 | |
| 308 | if (!result || !lua_getmetatable(L, index)) |
| 309 | return 0; |
| 310 | |
| 311 | lua_rawgeti(L, -1, 1); |
| 312 | |
| 313 | if (lua_tocfunction(L, -1) != &get_instance_value) |
| 314 | result = 0; |
| 315 | |
| 316 | lua_pop(L, 2); |
| 317 | |
| 318 | return result; |
| 319 | } |
| 320 | |
| 321 | LUABIND_API object_rep* push_new_instance(lua_State* L, class_rep* cls) |
| 322 | { |
no test coverage detected