Use ScriptRuntime.notAFunction to report bad ScriptableObject.callMethod arguments

This commit is contained in:
igor%mir2.org 2004-08-02 14:44:03 +00:00
Родитель 1cf362f6fe
Коммит 81e82296c8
1 изменённых файлов: 1 добавлений и 3 удалений

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

@ -1526,9 +1526,7 @@ public abstract class ScriptableObject implements Scriptable, Serializable,
{
Object funObj = getProperty(obj, methodName);
if (!(funObj instanceof Function)) {
throw ScriptRuntime.typeError1(
"msg.isnt.function",
ScriptRuntime.toString(obj)+'.'+methodName);
throw ScriptRuntime.notFunctionError(obj, methodName);
}
Function fun = (Function)funObj;
return fun.call(cx, getTopLevelScope(obj), obj, args);