aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsundar <none@none>2014-01-07 18:14:18 +0530
committersundar <none@none>2014-01-07 18:14:18 +0530
commitd0c52de061c7fc783a96de7f1b7323aa6979ccba (patch)
treec84a5b2902dc1759c63fc1149dcb5b7ad76f40c7 /src
parent48d121ce31e9b560f71dd85db920e016a40cda0c (diff)
downloadnashorn-d0c52de061c7fc783a96de7f1b7323aa6979ccba.tar.gz
8029003: setField in ScriptObject is incorrect for non extensible objects
Reviewed-by: lagergren, jlaskey
Diffstat (limited to 'src')
-rw-r--r--src/jdk/nashorn/internal/runtime/ScriptObject.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jdk/nashorn/internal/runtime/ScriptObject.java b/src/jdk/nashorn/internal/runtime/ScriptObject.java
index 02160d69..a493f3a2 100644
--- a/src/jdk/nashorn/internal/runtime/ScriptObject.java
+++ b/src/jdk/nashorn/internal/runtime/ScriptObject.java
@@ -1888,7 +1888,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
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 {