Fix bug Bug 443491 for an assignment to a property with only a getter defined, the assignment should cancel out the getter

This commit is contained in:
nboyd%atg.com 2008-07-03 20:16:59 +00:00
Родитель 03fb0e0b51
Коммит 48da715e4b
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -2067,7 +2067,11 @@ public abstract class ScriptableObject implements Scriptable, Serializable,
return true;
if (slot instanceof GetterSlot) {
Object setterObj = ((GetterSlot)slot).setter;
if (setterObj != null) {
if (setterObj == null) {
// Odd case: Assignment to a property with only a getter
// defined. The assignment cancels out the getter.
((GetterSlot)slot).getter = null;
} else {
Context cx = Context.getContext();
if (setterObj instanceof MemberBox) {
MemberBox nativeSetter = (MemberBox)setterObj;