Skip to content
Snippets Groups Projects
Commit eb39ffb8 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Don't throw an exception when setting or getting class properties.

Doing so prevents extending the prototype.
parent 924367a2
No related branches found
No related tags found
No related merge requests found
...@@ -2272,8 +2272,8 @@ static JSBool js_file_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, ...@@ -2272,8 +2272,8 @@ static JSBool js_file_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict,
jsrefcount rc; jsrefcount rc;
char* str = NULL; char* str = NULL;
if((p=(private_t*)js_GetClassPrivate(cx, obj, &js_file_class))==NULL) { if((p=(private_t*)JS_GetInstancePrivate(cx, obj, &js_file_class, NULL))==NULL) {
return(JS_FALSE); return(JS_TRUE);
} }
JS_IdToValue(cx, id, &idval); JS_IdToValue(cx, id, &idval);
...@@ -2411,8 +2411,8 @@ static JSBool js_file_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) ...@@ -2411,8 +2411,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_GetInstancePrivate(cx, obj, NULL, NULL))==NULL)
return(JS_FALSE); return(JS_TRUE);
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