Piotr Caban : jscript: Added VBArray.dimensions() implementation.
Alexandre Julliard
julliard at winehq.org
Mon Oct 18 13:36:57 CDT 2010
Module: wine
Branch: master
Commit: 2f4607887fee4284cf7cfaf061ea51fa4522e51b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2f4607887fee4284cf7cfaf061ea51fa4522e51b
Author: Piotr Caban <piotr at codeweavers.com>
Date: Mon Oct 18 18:47:46 2010 +0200
jscript: Added VBArray.dimensions() implementation.
---
dlls/jscript/tests/api.js | 1 +
dlls/jscript/vbarray.c | 13 +++++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 72ed4ea..07fa59b 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -2253,6 +2253,7 @@ ok(String.length == 1, "String.length = " + String.length);
var tmp = new VBArray(createArray());
tmp = new VBArray(VBArray(createArray()));
+ok(tmp.dimensions() == 2, "tmp.dimensions() = " + tmp.dimensions());
ok(tmp.lbound() == 0, "tmp.lbound() = " + tmp.lbound());
ok(tmp.lbound(1) == 0, "tmp.lbound(1) = " + tmp.lbound(1));
ok(tmp.lbound(2, 1) == 2, "tmp.lbound(2, 1) = " + tmp.lbound(2, 1));
diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c
index 1257d56..2ad3db1 100644
--- a/dlls/jscript/vbarray.c
+++ b/dlls/jscript/vbarray.c
@@ -47,8 +47,17 @@ static inline VBArrayInstance *vbarray_this(vdisp_t *jsthis)
static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller)
{
- FIXME("\n");
- return E_NOTIMPL;
+ VBArrayInstance *vbarray;
+
+ TRACE("\n");
+
+ vbarray = vbarray_this(vthis);
+ if(!vbarray)
+ return throw_type_error(ctx, ei, IDS_NOT_VBARRAY, NULL);
+
+ if(retv)
+ num_set_val(retv, SafeArrayGetDim(vbarray->safearray));
+ return S_OK;
}
static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
More information about the wine-cvs
mailing list