Skip to content
Snippets Groups Projects
Commit cec6efe8 authored by deuce's avatar deuce
Browse files

We can't throww an exception from the get function when private data is

NULL because the get function is called on the prototype which isn't
constructed (via the constructor).
parent c6c8a41c
No related branches found
No related tags found
No related merge requests found
...@@ -1931,10 +1931,8 @@ static JSBool js_file_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) ...@@ -1931,10 +1931,8 @@ static JSBool js_file_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
off_t lng; off_t lng;
int in; int in;
if((p=(private_t*)JS_GetPrivate(cx,obj))==NULL) { if((p=(private_t*)JS_GetPrivate(cx,obj))==NULL)
JS_ReportError(cx,getprivate_failure,WHERE);
return(JS_FALSE); return(JS_FALSE);
}
JS_IdToValue(cx, id, &idval); JS_IdToValue(cx, id, &idval);
tiny = JSVAL_TO_INT(idval); tiny = JSVAL_TO_INT(idval);
......
...@@ -2033,10 +2033,8 @@ static JSBool js_msgbase_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) ...@@ -2033,10 +2033,8 @@ static JSBool js_msgbase_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
private_t* p; private_t* p;
jsrefcount rc; jsrefcount rc;
if((p=(private_t*)JS_GetPrivate(cx,obj))==NULL) { if((p=(private_t*)JS_GetPrivate(cx,obj))==NULL)
JS_ReportError(cx,getprivate_failure,WHERE);
return(JS_FALSE); return(JS_FALSE);
}
JS_IdToValue(cx, id, &idval); JS_IdToValue(cx, id, &idval);
tiny = JSVAL_TO_INT(idval); tiny = JSVAL_TO_INT(idval);
......
...@@ -302,10 +302,8 @@ static JSBool js_queue_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) ...@@ -302,10 +302,8 @@ static JSBool js_queue_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
msg_queue_t* q; msg_queue_t* q;
jsrefcount rc; jsrefcount rc;
if((q=(msg_queue_t*)JS_GetPrivate(cx,obj))==NULL) { if((q=(msg_queue_t*)JS_GetPrivate(cx,obj))==NULL)
JS_ReportError(cx,getprivate_failure,WHERE); return JS_FALSE;
return(JS_FALSE);
}
JS_IdToValue(cx, id, &idval); JS_IdToValue(cx, id, &idval);
tiny = JSVAL_TO_INT(idval); tiny = JSVAL_TO_INT(idval);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment