jscript: Avoid calling JS builtin functions directly.

This commit is contained in:
Jacek Caban 2009-09-23 16:14:25 +02:00 committed by Alexandre Julliard
parent 0b4fa6e426
commit a5e8281947

View File

@ -85,14 +85,10 @@ static HRESULT String_length(script_ctx_t *ctx, DispatchEx *dispex, WORD flags,
return S_OK;
}
/* ECMA-262 3rd Edition 15.5.4.2 */
static HRESULT String_toString(script_ctx_t *ctx, DispatchEx *dispex, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
static HRESULT stringobj_to_string(DispatchEx *dispex, VARIANT *retv)
{
StringInstance *string;
TRACE("\n");
if(!is_class(dispex, JSCLASS_STRING)) {
WARN("this is not a string object\n");
return E_FAIL;
@ -111,13 +107,22 @@ static HRESULT String_toString(script_ctx_t *ctx, DispatchEx *dispex, WORD flags
return S_OK;
}
/* ECMA-262 3rd Edition 15.5.4.2 */
static HRESULT String_toString(script_ctx_t *ctx, DispatchEx *dispex, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
TRACE("\n");
return stringobj_to_string(dispex, retv);
}
/* ECMA-262 3rd Edition 15.5.4.2 */
static HRESULT String_valueOf(script_ctx_t *ctx, DispatchEx *dispex, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
TRACE("\n");
return String_toString(ctx, dispex, flags, dp, retv, ei, sp);
return stringobj_to_string(dispex, retv);
}
static HRESULT do_attributeless_tag_format(DispatchEx *dispex, WORD flags, DISPPARAMS *dp,