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

Function gjs_param_constructor

gi/param.cpp:108–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108GJS_JSAPI_RETURN_CONVENTION
109static bool gjs_param_constructor(JSContext* cx, unsigned argc, JS::Value* vp) {
110 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
111
112 if (!args.isConstructing()) {
113 gjs_throw_constructor_error(cx);
114 return false;
115 }
116
117 JS::RootedObject new_object(
118 cx, JS_NewObjectForConstructor(cx, &gjs_param_class, args));
119 if (!new_object)
120 return false;
121
122 GJS_INC_COUNTER(param);
123
124 args.rval().setObject(*new_object);
125 return true;
126}
127
128static void param_finalize(JS::GCContext*, JSObject* obj) {
129 Param* priv = JS::GetMaybePtrFromReservedSlot<Param>(obj, POINTER);

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected