Skip to content
Snippets Groups Projects
Commit 5ec7399e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add Archive.supported_formats (array of strings)

Helpful for scripts that want to know what file types (extensions) are
supported by the Archive class object.

Still need to work out the JSDOC support for this. Similar to the
Socket class object properties, this will have no documentation/description.
parent c24667c8
No related branches found
No related tags found
No related merge requests found
Pipeline #7761 failed
......@@ -705,11 +705,21 @@ JSClass js_archive_class = {
JSObject* js_CreateArchiveClass(JSContext* cx, JSObject* parent)
{
return JS_InitClass(cx, parent, NULL
JSObject* obj = JS_InitClass(cx, parent, NULL
,&js_archive_class
,js_archive_constructor
,1 /* number of constructor args */
,NULL /* props, set in constructor */
,NULL /* funcs, set in constructor */
,NULL, NULL);
if(obj != NULL) {
jsval val;
if(JS_GetProperty(cx, parent, js_archive_class.name, &val) && !JSVAL_NULL_OR_VOID(val)) {
JSObject* constructor;
JS_ValueToObject(cx, val, &constructor);
js_CreateArrayOfStrings(cx, constructor, "supported_formats", supported_archive_formats
,JSPROP_PERMANENT|JSPROP_ENUMERATE|JSPROP_READONLY);
}
}
return obj;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment