Fix for(i in null) and for(i in undefined) to error per ECMA, rather than iterating zero times (121744, r=khanson, sr=shaver).

git-svn-id: svn://10.0.0.236/trunk@113304 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%mozilla.org 2002-01-31 07:30:05 +00:00
parent c43af1c5c6
commit 7804e10cfe

View File

@ -1576,9 +1576,11 @@ js_Interpret(JSContext *cx, jsval *result)
case JSOP_TOOBJECT:
SAVE_SP(fp);
ok = js_ValueToObject(cx, FETCH_OPND(-1), &obj);
if (!ok)
obj = js_ValueToNonNullObject(cx, FETCH_OPND(-1));
if (!obj) {
ok = JS_FALSE;
goto out;
}
STORE_OPND(-1, OBJECT_TO_JSVAL(obj));
break;