-
Bug
-
Resolution: Fixed
-
P3
-
9
-
None
-
b02
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045063 | 8u25 | Sundararajan Athijegannathan | P3 | Resolved | Fixed | b01 |
JDK-8037980 | 8u20 | Sundararajan Athijegannathan | P3 | Resolved | Fixed | b09 |
JDK-8052463 | emb-8u26 | Sundararajan Athijegannathan | P3 | Resolved | Fixed | b18 |
It always throws a type errors, even if we are not in strict mode. the correct behaviour here according to spec is to be a nop. The spill setters do it right.
@SuppressWarnings("unused")
private static void setField(final CallSiteDescriptor desc, final PropertyMap oldMap, final PropertyMap newMap, final MethodHandle setter, final Object self, final Object value) throws Throwable {
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));
} else if (obj.compareAndSetMap(oldMap, newMap)) {
setter.invokeExact(self, value);
} else {
obj.set(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND), value, isStrict);
}
}
As this is so small, and we haven't gotten in trouble yet, I suggest postponing to 8u20
@SuppressWarnings("unused")
private static void setField(final CallSiteDescriptor desc, final PropertyMap oldMap, final PropertyMap newMap, final MethodHandle setter, final Object self, final Object value) throws Throwable {
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));
} else if (obj.compareAndSetMap(oldMap, newMap)) {
setter.invokeExact(self, value);
} else {
obj.set(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND), value, isStrict);
}
}
As this is so small, and we haven't gotten in trouble yet, I suggest postponing to 8u20
- backported by
-
JDK-8037980 setField in ScriptObject is incorrect for non extensible objects
- Resolved
-
JDK-8045063 setField in ScriptObject is incorrect for non extensible objects
- Resolved
-
JDK-8052463 setField in ScriptObject is incorrect for non extensible objects
- Resolved