Don't allow setting a property when the prototype's property is read-only.

This commit is contained in:
Tor Andersson
2018-09-04 16:30:50 +02:00
parent 90aca80865
commit 8c5f2f24c7

View File

@@ -610,6 +610,8 @@ static void jsR_setproperty(js_State *J, js_Object *obj, const char *name)
if (J->strict)
if (ref->getter)
js_typeerror(J, "setting property '%s' that only has a getter", name);
if (ref->atts & JS_READONLY)
goto readonly;
}
}