Skip to content
Snippets Groups Projects
Commit fb00000a 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 b6c43f66
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1210 passed
......@@ -2272,8 +2272,8 @@ static JSBool js_file_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict,
jsrefcount rc;
char* str = NULL;
if((p=(private_t*)js_GetClassPrivate(cx, obj, &js_file_class))==NULL) {
return(JS_FALSE);
if((p=(private_t*)JS_GetInstancePrivate(cx, obj, &js_file_class, NULL))==NULL) {
return(JS_TRUE);
}
JS_IdToValue(cx, id, &idval);
......@@ -2411,8 +2411,8 @@ static JSBool js_file_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
off_t lng;
int in;
if((p=(private_t*)JS_GetPrivate(cx,obj))==NULL)
return(JS_FALSE);
if((p=(private_t*)JS_GetInstancePrivate(cx, obj, NULL, NULL))==NULL)
return(JS_TRUE);
JS_IdToValue(cx, id, &idval);
tiny = JSVAL_TO_INT(idval);
......
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