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

This commit is contained in:
brendan%mozilla.org 2002-01-31 07:30:05 +00:00
Родитель 1099de413c
Коммит fdf6f6bfee
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -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;