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

jscript: Added support for VT_R4 VARIANT types.

parent ae65558b
......@@ -303,6 +303,9 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
case VT_UI4:
*r = jsval_number(V_UI4(var));
return S_OK;
case VT_R4:
*r = jsval_number(V_R4(var));
return S_OK;
case VT_UNKNOWN:
if(V_UNKNOWN(var)) {
IDispatch *disp;
......
......@@ -1315,7 +1315,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
return S_OK;
case DISPID_GLOBAL_TESTARGTYPES: {
VARIANT args[6], v;
VARIANT args[7], v;
DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0};
HRESULT hres;
......@@ -1355,6 +1355,8 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_UI4(args+4) = 0xffffffff;
V_VT(args+5) = VT_BYREF|VT_VARIANT;
V_VARIANTREF(args+5) = &v;
V_VT(args+6) = VT_R4;
V_R4(args+6) = 0.5;
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);
......@@ -2644,7 +2646,8 @@ 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(i4ref,ui4,nullunk,d,i,s) {"
parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp,"
"function(r4,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));"
......@@ -2654,6 +2657,8 @@ static BOOL run_tests(void)
" ok(ui4 > 0, 'ui4 = ' + ui4);"
" ok(getVT(i4ref) === 'VT_I4', 'getVT(i4ref) = ' + getVT(i4ref));"
" ok(i4ref === 2, 'i4ref = ' + i4ref);"
" ok(r4 === 0.5, 'r4 = ' + r4);"
" ok(getVT(r4) === 'VT_R8', 'getVT(r4) = ' + getVT(r4));"
"});");
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