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

Function gjs_define_string_array

gjs/jsapi-util.cpp:216–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216JSObject* gjs_define_string_array(JSContext* cx, JS::HandleObject in_object,
217 const char* array_name,
218 const std::vector<std::string>& strings,
219 unsigned attrs) {
220 JS::RootedObject array{cx, gjs_build_string_array(cx, strings)};
221 if (!array)
222 return nullptr;
223
224 if (!JS_DefineProperty(cx, in_object, array_name, array, attrs))
225 return nullptr;
226
227 return array;
228}
229
230// Helper function: perform ToString on an exception (which may not even be an
231// object), except if it is an InternalError, which would throw in ToString.

Callers 2

gjs_create_importerFunction · 0.85

Calls 1

gjs_build_string_arrayFunction · 0.85

Tested by

no test coverage detected