Fix bug 582654 - NativeIterator.jsConstructor throws ArrayIndexOutOfBoundsException

git-svn-id: svn://10.0.0.236/trunk@260900 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hannes%helma.at 2010-07-28 18:20:26 +00:00
parent c0fa695e18
commit 6bebec172c

View File

@ -163,8 +163,9 @@ public final class NativeIterator extends IdScriptableObject {
if (args.length == 0 || args[0] == null ||
args[0] == Undefined.instance)
{
Object argument = args.length == 0 ? Undefined.instance : args[0];
throw ScriptRuntime.typeError1("msg.no.properties",
ScriptRuntime.toString(args[0]));
ScriptRuntime.toString(argument));
}
Scriptable obj = ScriptRuntime.toObject(scope, args[0]);
boolean keyOnly = args.length > 1 && ScriptRuntime.toBoolean(args[1]);