jscript: for..in is not error if in expression is not an object.
This commit is contained in:
parent
c6188fdffc
commit
2efae9e79b
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue