Commit 1926b561 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use to_int32 in to_uint32 implementation.

parent add71cb9
......@@ -320,7 +320,7 @@ HRESULT to_boolean(jsval_t,BOOL*) DECLSPEC_HIDDEN;
HRESULT to_number(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN;
HRESULT to_integer(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN;
HRESULT to_int32(script_ctx_t*,jsval_t,INT*) DECLSPEC_HIDDEN;
HRESULT to_uint32(script_ctx_t*,jsval_t,DWORD*) DECLSPEC_HIDDEN;
HRESULT to_uint32(script_ctx_t*,jsval_t,UINT32*) DECLSPEC_HIDDEN;
HRESULT to_string(script_ctx_t*,jsval_t,jsstr_t**) DECLSPEC_HIDDEN;
HRESULT to_object(script_ctx_t*,jsval_t,IDispatch**) DECLSPEC_HIDDEN;
......
......@@ -665,15 +665,13 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret)
/* ECMA-262 3rd Edition 9.6 */
HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, DWORD *ret)
{
double n;
INT32 n;
HRESULT hres;
hres = to_number(ctx, val, &n);
if(FAILED(hres))
return hres;
*ret = isnan(n) || isinf(n) ? 0 : n;
return S_OK;
hres = to_int32(ctx, val, &n);
if(SUCCEEDED(hres))
*ret = n;
return hres;
}
static jsstr_t *int_to_string(int 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