| 594 | } |
| 595 | |
| 596 | std::string gjs_debug_callable(JSObject* callable) { |
| 597 | if (JSFunction* fn = JS_GetObjectFunction(callable)) { |
| 598 | if (JSString* display_id = JS_GetMaybePartialFunctionDisplayId(fn)) |
| 599 | return {"function " + gjs_debug_string(display_id)}; |
| 600 | return {"unnamed function"}; |
| 601 | } |
| 602 | return {"callable object " + gjs_debug_object(callable)}; |
| 603 | } |
| 604 | |
| 605 | std::string gjs_debug_value(JS::Value v) { |
| 606 | if (v.isNull()) |
no test coverage detected