shithub: libmujs

Download patch

ref: 543115ba39599d7cc5349cc76997b683d8a129b1
parent: 91dc20d3e3bdf5e30a5a750fcb35395d570673e1
author: Tor Andersson <tor.andersson@artifex.com>
date: Wed Jan 7 13:08:10 EST 2015

strict mode: Errors when extending non-extensible objects.

--- a/jsproperty.c
+++ b/jsproperty.c
@@ -206,8 +206,12 @@
 {
 	js_Property *result;
 
-	if (!obj->extensible)
-		return lookup(obj->properties, name);
+	if (!obj->extensible) {
+		result = lookup(obj->properties, name);
+		if (J->strict && !result)
+			js_typeerror(J, "object is non-extensible");
+		return result;
+	}
 
 	obj->properties = insert(J, obj, obj->properties, name, &result);
 	if (!result->prevp) {