mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-14 00:49:42 +00:00
8029003: setField in ScriptObject is incorrect for non extensible objects
Reviewed-by: lagergren, jlaskey
This commit is contained in:
parent
ab0a342a89
commit
a26dd7a41b
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user