summaryrefslogtreecommitdiff
path: root/javascript/jsapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/jsapi.c')
-rw-r--r--javascript/jsapi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/javascript/jsapi.c b/javascript/jsapi.c
index 7780e77e6..5bac27510 100644
--- a/javascript/jsapi.c
+++ b/javascript/jsapi.c
@@ -313,17 +313,19 @@ disable_heartbeat(struct heartbeat *hb)
#endif
-jscontext *js_newcontext(int timeout, jscallback *cb, void *cbctx)
+nserror js_newcontext(int timeout, jscallback *cb, void *cbctx,
+ jscontext **jsctx)
{
JSContext *cx;
+ *jsctx = NULL;
if (rt == NULL) {
- return NULL;
+ return NSERROR_OK;
}
cx = JS_NewContext(rt, 8192);
if (cx == NULL) {
- return NULL;
+ return NSERROR_NOMEM;
}
/* set options on context */
@@ -339,7 +341,8 @@ jscontext *js_newcontext(int timeout, jscallback *cb, void *cbctx)
JSLOG("New Context %p", cx);
- return (jscontext *)cx;
+ r*jsctx = (jscontext *)cx;
+ return NSERROR_OK;
}
void js_destroycontext(jscontext *ctx)