jscript: Always use jsval-based to_uint32 implementation.

This commit is contained in:
Jacek Caban 2012-09-17 15:18:41 +02:00 committed by Alexandre Julliard
parent 0bab034fac
commit 2fc71ab6d5
6 changed files with 6 additions and 33 deletions

View File

@ -79,7 +79,7 @@ static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsexcept_t *ei, jsd
if(FAILED(hres))
return hres;
hres = to_uint32_jsval(ctx, val, ei, ret);
hres = to_uint32(ctx, val, ei, ret);
jsval_release(val);
if(FAILED(hres))
return hres;

View File

@ -160,7 +160,7 @@ static inline HRESULT stack_pop_int(exec_ctx_t *ctx, INT *r)
static inline HRESULT stack_pop_uint(exec_ctx_t *ctx, DWORD *r)
{
return to_uint32_jsval(ctx->script, stack_pop(ctx), ctx->ei, r);
return to_uint32(ctx->script, stack_pop(ctx), ctx->ei, r);
}
static inline IDispatch *stack_pop_objid(exec_ctx_t *ctx, DISPID *id)

View File

@ -347,7 +347,7 @@ static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, jsexcept_t
if(FAILED(hres))
return hres;
hres = to_uint32_jsval(ctx, val, ei, &length);
hres = to_uint32(ctx, val, ei, &length);
jsval_release(val);
if(FAILED(hres))
return hres;

View File

@ -259,8 +259,7 @@ HRESULT to_boolean(jsval_t,BOOL*) DECLSPEC_HIDDEN;
HRESULT to_number(script_ctx_t*,jsval_t,jsexcept_t*,double*) DECLSPEC_HIDDEN;
HRESULT to_integer(script_ctx_t*,jsval_t,jsexcept_t*,double*) DECLSPEC_HIDDEN;
HRESULT to_int32(script_ctx_t*,jsval_t,jsexcept_t*,INT*) DECLSPEC_HIDDEN;
HRESULT to_uint32(script_ctx_t*,VARIANT*,jsexcept_t*,DWORD*) DECLSPEC_HIDDEN;
HRESULT to_uint32_jsval(script_ctx_t*,jsval_t,jsexcept_t*,DWORD*) DECLSPEC_HIDDEN;
HRESULT to_uint32(script_ctx_t*,jsval_t,jsexcept_t*,DWORD*) DECLSPEC_HIDDEN;
HRESULT to_string(script_ctx_t*,VARIANT*,jsexcept_t*,BSTR*) DECLSPEC_HIDDEN;
HRESULT to_string_jsval(script_ctx_t*,jsval_t,jsexcept_t*,BSTR*) DECLSPEC_HIDDEN;
HRESULT to_object(script_ctx_t*,VARIANT*,IDispatch**) DECLSPEC_HIDDEN;

View File

@ -645,23 +645,12 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, jsexcept_t *ei, INT *ret)
}
/* ECMA-262 3rd Edition 9.6 */
HRESULT to_uint32(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, DWORD *ret)
HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, DWORD *ret)
{
jsval_t val;
double n;
HRESULT hres;
if(V_VT(v) == VT_I4) {
*ret = V_I4(v);
return S_OK;
}
hres = variant_to_jsval(v, &val);
if(FAILED(hres))
return hres;
hres = to_number(ctx, val, ei, &n);
jsval_release(val);
if(FAILED(hres))
return hres;
@ -669,21 +658,6 @@ HRESULT to_uint32(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, DWORD *ret)
return S_OK;
}
/* ECMA-262 3rd Edition 9.6 */
HRESULT to_uint32_jsval(script_ctx_t *ctx, jsval_t v, jsexcept_t *ei, DWORD *ret)
{
VARIANT var;
HRESULT hres;
hres = jsval_to_variant(v, &var);
if(FAILED(hres))
return hres;
hres = to_uint32(ctx, &var, ei, ret);
VariantClear(&var);
return hres;
}
static BSTR int_to_bstr(int i)
{
WCHAR buf[12], *p;

View File

@ -1531,7 +1531,7 @@ static HRESULT StringConstr_fromCharCode(script_ctx_t *ctx, vdisp_t *jsthis, WOR
return E_OUTOFMEMORY;
for(i=0; i<argc; i++) {
hres = to_uint32_jsval(ctx, argv[i], ei, &code);
hres = to_uint32(ctx, argv[i], ei, &code);
if(FAILED(hres)) {
SysFreeString(ret);
return hres;