| 281 | |
| 282 | template <class Base, class Prototype, class Instance> |
| 283 | bool BoxedInstance<Base, Prototype, Instance>::invoke_static_method( |
| 284 | JSContext* cx, JS::HandleObject obj, JS::HandleId method_name, |
| 285 | const JS::CallArgs& args) { |
| 286 | GjsContextPrivate* gjs = GjsContextPrivate::from_cx(cx); |
| 287 | JS::RootedObject js_constructor{cx}; |
| 288 | |
| 289 | if (!gjs_object_require_property( |
| 290 | cx, obj, nullptr, gjs->atoms().constructor(), &js_constructor)) |
| 291 | return false; |
| 292 | |
| 293 | JS::RootedValue method{cx}; |
| 294 | if (!gjs_object_require_property(cx, js_constructor, nullptr, method_name, |
| 295 | &method)) |
| 296 | return false; |
| 297 | |
| 298 | return gjs->call_function(nullptr, method, args, args.rval()); |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * BoxedInstance::copy_boxed: |
nothing calls this directly
no test coverage detected