1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

Add elinks.home property.

This commit is contained in:
Miciah Dashiel Butler Masters 2005-12-29 14:19:09 +00:00 committed by Miciah Dashiel Butler Masters
parent a4be153703
commit ae42c586f8

View File

@ -6,6 +6,7 @@
#include "elinks.h"
#include "config/home.h"
#include "ecmascript/spidermonkey/util.h"
#include "protocol/uri.h"
#include "scripting/scripting.h"
@ -19,6 +20,14 @@
#include "session/task.h"
static JSBool
elinks_get_home(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(smjs_ctx, elinks_home));
return JS_TRUE;
}
static JSBool
elinks_get_location(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -102,6 +111,12 @@ smjs_get_elinks_object(void)
elinks_get_location, elinks_set_location,
JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineProperty(smjs_ctx, jsobj, "home", JSVAL_NULL,
elinks_get_home, JS_PropertyStub,
JSPROP_ENUMERATE
| JSPROP_PERMANENT
| JSPROP_READONLY);
return jsobj;
}