jscript: Inherit Math from Object.

This commit is contained in:
Piotr Caban 2009-08-14 11:58:54 +02:00 committed by Alexandre Julliard
parent 6b8fef873c
commit c368ab5ba7
2 changed files with 16 additions and 1 deletions

View File

@ -602,5 +602,19 @@ static const builtin_info_t Math_info = {
HRESULT create_math(script_ctx_t *ctx, DispatchEx **ret)
{
return create_dispex(ctx, &Math_info, NULL, ret);
DispatchEx *math;
HRESULT hres;
math = heap_alloc_zero(sizeof(DispatchEx));
if(!math)
return E_OUTOFMEMORY;
hres = init_dispex_from_constr(math, ctx, &Math_info, ctx->object_constr);
if(FAILED(hres)) {
heap_free(math);
return hres;
}
*ret = math;
return S_OK;
}

View File

@ -1394,5 +1394,6 @@ testObjectInherit(new Boolean(true), false, true, false);
testObjectInherit(new Array(), false, false, true);
testObjectInherit(new Error(), false, true, true);
testObjectInherit(testObjectInherit, false, true, true);
testObjectInherit(Math, true, true, true);
reportSuccess();