mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
jscript: Fixed to_object for NULL IDispatch.
This commit is contained in:
parent
1a6aa96305
commit
a8c7e97d0a
@ -603,8 +603,18 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
|
||||
*disp = (IDispatch*)_IDispatchEx_(dispex);
|
||||
break;
|
||||
case VT_DISPATCH:
|
||||
IDispatch_AddRef(V_DISPATCH(v));
|
||||
*disp = V_DISPATCH(v);
|
||||
if(V_DISPATCH(v)) {
|
||||
IDispatch_AddRef(V_DISPATCH(v));
|
||||
*disp = V_DISPATCH(v);
|
||||
}else {
|
||||
DispatchEx *obj;
|
||||
|
||||
hres = create_object(ctx, NULL, &obj);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
*disp = (IDispatch*)_IDispatchEx_(obj);
|
||||
}
|
||||
break;
|
||||
case VT_BOOL:
|
||||
hres = create_bool(ctx, V_BOOL(v), &dispex);
|
||||
|
@ -948,6 +948,11 @@ ok(!nullDisp === true, "!nullDisp = " + !nullDisp);
|
||||
ok(String(nullDisp) === "null", "String(nullDisp) = " + String(nullDisp));
|
||||
ok(nullDisp != new Object(), "nullDisp == new Object()");
|
||||
ok(new Object() != nullDisp, "new Object() == nullDisp");
|
||||
ok((typeof Object(nullDisp)) === "object", "typeof Object(nullDisp) !== 'object'");
|
||||
tmp = getVT(Object(nullDisp));
|
||||
ok(tmp === "VT_DISPATCH", "getVT(Object(nullDisp) = " + tmp);
|
||||
tmp = Object(nullDisp).toString();
|
||||
ok(tmp === "[object Object]", "Object(nullDisp).toString() = " + tmp);
|
||||
|
||||
function do_test() {}
|
||||
function nosemicolon() {} nosemicolon();
|
||||
|
Loading…
Reference in New Issue
Block a user