MCPcopy Create free account
hub / github.com/GNOME/gjs / invoke_constructor

Method invoke_constructor

gi/fundamental.cpp:165–179  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

163 * arguments.
164 */
165bool 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().
182bool FundamentalInstance::constructor_impl(JSContext* cx,

Callers

nothing calls this directly

Calls 3

gjs_throwFunction · 0.85
constructor_infoMethod · 0.80

Tested by

no test coverage detected