shithub: libmujs

Download patch

ref: 8c5f2f24c7d7da0a2fceaf32aaa9e80d0b3b7c86
parent: 90aca80865e28a1b9be9bc5ef1118438f62e4f8f
author: Tor Andersson <[email protected]>
date: Tue Sep 4 12:30:50 EDT 2018

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

--- a/jsrun.c
+++ b/jsrun.c
@@ -610,6 +610,8 @@
 			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;
 		}
 	}