jscript: Added VT_R8 to string conversion implementation.

This commit is contained in:
Jacek Caban 2008-09-25 00:50:49 +02:00 committed by Alexandre Julliard
parent 8597d42cf5
commit 53040deefd
2 changed files with 14 additions and 0 deletions

View File

@ -441,6 +441,18 @@ HRESULT to_string(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, BSTR *str)
case VT_I4:
*str = int_to_bstr(V_I4(v));
break;
case VT_R8: {
VARIANT strv;
HRESULT hres;
V_VT(&strv) = VT_EMPTY;
hres = VariantChangeType(&strv, v, 0, VT_BSTR);
if(FAILED(hres))
return hres;
*str = V_BSTR(&strv);
return S_OK;
}
case VT_BSTR:
*str = SysAllocString(V_BSTR(v));
break;

View File

@ -366,6 +366,8 @@ ok("" + null === "null", "\"\" + null !== \"null\"");
ok("" + undefined === "undefined", "\"\" + undefined !== \"undefined\"");
ok("" + true === "true", "\"\" + true !== \"true\"");
ok("" + false === "false", "\"\" + false !== \"false\"");
ok("" + 0.5 === "0.5", "'' + 0.5 = " + 0.5);
ok("" + (-0.5432) === "-0.5432", "'' + (-0.5432) = " + (-0.5432));
ok(1 < 3.4, "1 < 3.4 failed");
ok(!(3.4 < 1), "3.4 < 1");