Commit 7e2022cb authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Add a js.options property to report the option flags used for the JS ctx

parent 42b91547
Pipeline #1423 passed with stage
in 9 minutes and 22 seconds
......@@ -41,6 +41,7 @@ enum {
,PROP_MAXBYTES
#endif
,PROP_GLOBAL
,PROP_OPTIONS
};
static JSBool js_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
......@@ -107,6 +108,9 @@ static JSBool js_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
case PROP_GLOBAL:
*vp = OBJECT_TO_JSVAL(JS_GetGlobalObject(cx));
break;
case PROP_OPTIONS:
*vp = UINT_TO_JSVAL(JS_GetOptions(cx));
break;
}
return(JS_TRUE);
......@@ -181,6 +185,7 @@ static jsSyncPropertySpec js_properties[] = {
{ "max_bytes", PROP_MAXBYTES, JSPROP_ENUMERATE, 311 },
#endif
{ "global", PROP_GLOBAL, PROP_FLAGS, 314 },
{ "options", PROP_OPTIONS, PROP_FLAGS, 31802 },
{0}
};
......@@ -201,6 +206,7 @@ static char* prop_desc[] = {
,"maximum number of bytes available for heap"
#endif
,"global (top level) object - <small>READ ONLY</small>"
,"option flags - <small>READ ONLY</small>"
/* New properties go here... */
,"full path and filename of JS file executed"
,"directory of executed JS file"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment