Yet another improvement in not-a-function reporting. Now for foo.bar() when bar does not exist Rhino prints "Can not find function bar"

git-svn-id: svn://10.0.0.236/trunk@179198 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
igor%mir2.org
2005-08-29 14:59:27 +00:00
parent 0b4f4e37b3
commit 8e13c5ea26
2 changed files with 6 additions and 0 deletions

View File

@@ -3304,6 +3304,9 @@ public class ScriptRuntime {
// XXX Use value for better error reporting
String msg = (messageHelper == null)
? "null" : messageHelper.toString();
if (value == Scriptable.NOT_FOUND) {
return typeError1("msg.function.not.found", msg);
}
return typeError2("msg.isnt.function", msg,
value == null ? "null" : value.getClass().getName());
}

View File

@@ -451,6 +451,9 @@ msg.undef.with =\
msg.isnt.function =\
{0} is not a function, it is {1}.
msg.function.not.found =\
Cannot find function {0}.
msg.isnt.xml.object =\
{0} is not an xml object.