changeset 701:d6e66fef38eb

8029003: setField in ScriptObject is incorrect for non extensible objects Reviewed-by: lagergren, jlaskey
author sundar
date Tue, 07 Jan 2014 18:14:18 +0530
parents 78cdf566535d
children 18eccb9656e0
files src/jdk/nashorn/internal/runtime/ScriptObject.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Jan 03 10:09:48 2014 +0530
+++ b/src/jdk/nashorn/internal/runtime/ScriptObject.java	Tue Jan 07 18:14:18 2014 +0530
@@ -1888,7 +1888,9 @@
         final ScriptObject obj = (ScriptObject)self;
         final boolean isStrict = NashornCallSiteDescriptor.isStrict(desc);
         if (!obj.isExtensible()) {
-            throw typeError("object.non.extensible", desc.getNameToken(2), ScriptRuntime.safeToString(obj));
+            if (isStrict) {
+                throw typeError("object.non.extensible", desc.getNameToken(2), ScriptRuntime.safeToString(obj));
+            }
         } else if (obj.compareAndSetMap(oldMap, newMap)) {
             setter.invokeExact(self, value);
         } else {