jscript: for..in is not error if in expression is not an object.

This commit is contained in:
Jacek Caban 2008-09-21 15:40:04 +02:00 committed by Alexandre Julliard
parent c6188fdffc
commit 2efae9e79b
2 changed files with 12 additions and 2 deletions

View File

@ -783,9 +783,10 @@ HRESULT forin_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t
return hres;
if(V_VT(&val) != VT_DISPATCH) {
FIXME("in vt %d\n", V_VT(&val));
TRACE("in vt %d\n", V_VT(&val));
VariantClear(&val);
return E_NOTIMPL;
V_VT(ret) = VT_EMPTY;
return S_OK;
}
hres = IDispatch_QueryInterface(V_DISPATCH(&val), &IID_IDispatchEx, (void**)&in_obj);

View File

@ -142,6 +142,15 @@ ok(obj2.pvar === 3, "obj2.pvar is not 3");
var obj3 = new Object;
ok(typeof(obj3) === "object", "typeof(obj3) is not object");
for(var iter in "test")
ok(false, "unexpected forin call, test = " + iter);
for(var iter in null)
ok(false, "unexpected forin call, test = " + iter);
for(var iter in false)
ok(false, "unexpected forin call, test = " + iter);
tmp = 0;
if(true)
tmp = 1;