* FundamentalInstance::invoke_constructor: * * Finds the type's static constructor method (the static method given by * FundamentalPrototype::constructor_info()) and invokes it with the given * arguments. */
| 163 | * arguments. |
| 164 | */ |
| 165 | bool FundamentalInstance::invoke_constructor(JSContext* cx, |
| 166 | JS::HandleObject obj, |
| 167 | const JS::CallArgs& args, |
| 168 | GIArgument* rvalue) { |
| 169 | Maybe<const GI::FunctionInfo> constructor_info = |
| 170 | get_prototype()->constructor_info(); |
| 171 | if (!constructor_info) { |
| 172 | gjs_throw(cx, "Couldn't find a constructor for type %s", |
| 173 | format_name().c_str()); |
| 174 | return false; |
| 175 | } |
| 176 | |
| 177 | return gjs_invoke_constructor_from_c(cx, *constructor_info, obj, args, |
| 178 | rvalue); |
| 179 | } |
| 180 | |
| 181 | // See GIWrapperBase::constructor(). |
| 182 | bool FundamentalInstance::constructor_impl(JSContext* cx, |
nothing calls this directly
no test coverage detected