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

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

parent 4b39f3fa
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ enum { ...@@ -41,6 +41,7 @@ enum {
,PROP_MAXBYTES ,PROP_MAXBYTES
#endif #endif
,PROP_GLOBAL ,PROP_GLOBAL
,PROP_OPTIONS
}; };
static JSBool js_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) 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) ...@@ -107,6 +108,9 @@ static JSBool js_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
case PROP_GLOBAL: case PROP_GLOBAL:
*vp = OBJECT_TO_JSVAL(JS_GetGlobalObject(cx)); *vp = OBJECT_TO_JSVAL(JS_GetGlobalObject(cx));
break; break;
case PROP_OPTIONS:
*vp = UINT_TO_JSVAL(JS_GetOptions(cx));
break;
} }
return(JS_TRUE); return(JS_TRUE);
...@@ -181,6 +185,7 @@ static jsSyncPropertySpec js_properties[] = { ...@@ -181,6 +185,7 @@ static jsSyncPropertySpec js_properties[] = {
{ "max_bytes", PROP_MAXBYTES, JSPROP_ENUMERATE, 311 }, { "max_bytes", PROP_MAXBYTES, JSPROP_ENUMERATE, 311 },
#endif #endif
{ "global", PROP_GLOBAL, PROP_FLAGS, 314 }, { "global", PROP_GLOBAL, PROP_FLAGS, 314 },
{ "options", PROP_OPTIONS, PROP_FLAGS, 31802 },
{0} {0}
}; };
...@@ -201,6 +206,7 @@ static char* prop_desc[] = { ...@@ -201,6 +206,7 @@ static char* prop_desc[] = {
,"maximum number of bytes available for heap" ,"maximum number of bytes available for heap"
#endif #endif
,"global (top level) object - <small>READ ONLY</small>" ,"global (top level) object - <small>READ ONLY</small>"
,"option flags - <small>READ ONLY</small>"
/* New properties go here... */ /* New properties go here... */
,"full path and filename of JS file executed" ,"full path and filename of JS file executed"
,"directory of executed JS file" ,"directory of executed JS file"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment