Skip to content
Snippets Groups Projects
Commit 28025035 authored by rswindell's avatar rswindell
Browse files

Fixed warning (from last commit) about JS_GetPrivate when constructing a new

User object.
parent 89132149
No related branches found
No related tags found
No related merge requests found
......@@ -886,16 +886,20 @@ js_user_constructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
if(!js_DefineSyncProperties(cx, obj, js_user_properties))
return(JS_FALSE);
if(!js_DefineSyncMethods(cx, obj, js_user_functions, FALSE))
return(JS_FALSE);
if((p=(private_t*)malloc(sizeof(private_t)))==NULL)
return(JS_FALSE);
p->cfg = scfg;
p->usernumber = user.number;
JS_SetPrivate(cx, obj, p);
JS_SetPrivate(cx, obj, p); /* Must do this before calling js_DefineSyncMethods() */
if(!js_DefineSyncMethods(cx, obj, js_user_functions, FALSE)) {
JS_SetPrivate(cx, obj, NULL);
free(p);
return(JS_FALSE);
}
JS_SetPrivate(cx, statsobj, p);
JS_SetPrivate(cx, securityobj, p);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment