From 73e6d8be93b739ccea3477e92d399886a4ed41e3 Mon Sep 17 00:00:00 2001 From: "nboyd%atg.com" Date: Thu, 3 Jul 2008 20:16:59 +0000 Subject: [PATCH] Fix bug Bug 443491 for an assignment to a property with only a getter defined, the assignment should cancel out the getter git-svn-id: svn://10.0.0.236/trunk@252841 18797224-902f-48f8-a5cc-f745e15eee43 --- .../rhino/src/org/mozilla/javascript/ScriptableObject.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java b/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java index 4f5e47ddf65..e011035d238 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java @@ -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;