Closed Bug 252122 Opened 21 years ago Closed 20 years ago

double expansion of error message

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: icarr, Assigned: igor)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2 the function undefWriteError in ScriptRuntime expands the message string then calls typeError2 which expands the message again resulting in a confusing error message of the form: TypeError: Cannot set property "repeat 1" of undefined to "Cannot set property "caption" of undefined to "repeat 1"" (rule script#23) instead of: TypeError: "Cannot set property "caption" of undefined to "repeat 1" (rule script#23) Fix, remove the call to getMessage2 and pass the paramters straight to typeError2 patch below Index: ScriptRuntime.java =================================================================== RCS file: /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java,v retrieving revision 1.181 diff -u -r1.181 ScriptRuntime.java --- ScriptRuntime.java 8 Jun 2004 23:28:32 -0000 1.181 +++ ScriptRuntime.java 19 Jul 2004 16:08:24 -0000 @@ -2420,8 +2420,8 @@ : "msg.undef.prop.write"; String valueStr = (value instanceof Scriptable) ? value.toString() : toString(value); - String msg = getMessage2(messageId, property, valueStr); - return typeError2(messageId, valueStr, msg); + // String msg = getMessage2(messageId, property, valueStr); + return typeError2(messageId, property, valueStr); } public static RuntimeException notFoundError(Scriptable object, String property) Reproducible: Always Steps to Reproduce: 1. 2. 3.
Thanks for spotting this, I will commit your patch to CVS sometime next week after merging E4X extensions into Rhino.
Status: NEW → ASSIGNED
Forgotten status change: this was fixed in 1.6R1
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6R1
You need to log in before you can comment on or make changes to this bug.