Commit a1543a3f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Fixed handling VT_VARIANT|VY_BYREF types.

parent 13164037
......@@ -246,6 +246,9 @@ HRESULT jsval_copy(jsval_t v, jsval_t *r)
HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
{
if(V_VT(var) == (VT_VARIANT|VT_BYREF))
var = V_VARIANTREF(var);
switch(V_VT(var)) {
case VT_EMPTY:
*r = jsval_undefined();
......
......@@ -1211,7 +1211,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
return S_OK;
case DISPID_GLOBAL_TESTARGTYPES: {
VARIANT args[5];
VARIANT args[6], v;
DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0};
HRESULT hres;
......@@ -1249,6 +1249,10 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_UNKNOWN(args+3) = NULL;
V_VT(args+4) = VT_UI4;
V_UI4(args+4) = 0xffffffff;
V_VT(args+5) = VT_BYREF|VT_VARIANT;
V_VARIANTREF(args+5) = &v;
V_VT(&v) = VT_I4;
V_I4(&v) = 2;
hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
......@@ -2412,14 +2416,16 @@ static BOOL run_tests(void)
CHECK_CALLED(global_propargput_i);
SET_EXPECT(global_testargtypes_i);
parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(ui4,nullunk,d,i,s) {"
parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(i4ref,ui4,nullunk,d,i,s) {"
" ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));"
" ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));"
" ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));"
" ok(getVT(nullunk) === 'VT_DISPATCH', 'getVT(nullunk) = ' + getVT(nullunk));"
" ok(nullunk === null, 'nullunk !== null');"
" ok(getVT(ui4) === 'VT_R8', 'getVT(s) = ' + getVT(s));"
" ok(getVT(ui4) === 'VT_R8', 'getVT(ui4) = ' + getVT(ui4));"
" ok(ui4 > 0, 'ui4 = ' + ui4);"
" ok(getVT(i4ref) === 'VT_I4', 'getVT(i4ref) = ' + getVT(i4ref));"
" ok(i4ref === 2, 'i4ref = ' + i4ref);"
"});");
CHECK_CALLED(global_testargtypes_i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment