Piotr Caban : jscript: Inherit Math from Object.
Alexandre Julliard
julliard at winehq.org
Fri Aug 14 09:00:37 CDT 2009
Module: wine
Branch: master
Commit: c368ab5ba7ac51c1568d0eb7bac7b629964de650
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c368ab5ba7ac51c1568d0eb7bac7b629964de650
Author: Piotr Caban <piotr.caban at gmail.com>
Date: Fri Aug 14 11:58:54 2009 +0200
jscript: Inherit Math from Object.
---
dlls/jscript/math.c | 16 +++++++++++++++-
dlls/jscript/tests/api.js | 1 +
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c
index b172ffd..8fea484 100644
--- a/dlls/jscript/math.c
+++ b/dlls/jscript/math.c
@@ -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;
}
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 7273309..5d97224 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -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();
More information about the wine-cvs
mailing list