From 8c5f2f24c7d7da0a2fceaf32aaa9e80d0b3b7c86 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 4 Sep 2018 16:30:50 +0200 Subject: [PATCH] Don't allow setting a property when the prototype's property is read-only. --- jsrun.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsrun.c b/jsrun.c index b77e641..9fb256a 100644 --- a/jsrun.c +++ b/jsrun.c @@ -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; } }