| 321 | } |
| 322 | |
| 323 | bool Squirrel::MethodExists(HSQOBJECT instance, std::string_view method_name) |
| 324 | { |
| 325 | assert(!this->crashed); |
| 326 | ScriptAllocatorScope alloc_scope(this); |
| 327 | |
| 328 | int top = sq_gettop(this->vm); |
| 329 | /* Go to the instance-root */ |
| 330 | sq_pushobject(this->vm, instance); |
| 331 | /* Find the function-name inside the script */ |
| 332 | sq_pushstring(this->vm, method_name); |
| 333 | if (SQ_FAILED(sq_get(this->vm, -2))) { |
| 334 | sq_settop(this->vm, top); |
| 335 | return false; |
| 336 | } |
| 337 | sq_settop(this->vm, top); |
| 338 | return true; |
| 339 | } |
| 340 | |
| 341 | bool Squirrel::Resume(int suspend) |
| 342 | { |
no test coverage detected