Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
29cdb212
Commit
29cdb212
authored
Oct 18, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added VBArray.toArray() implementation.
parent
41d7f8fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
api.js
dlls/jscript/tests/api.js
+1
-0
vbarray.c
dlls/jscript/vbarray.c
+43
-2
No files found.
dlls/jscript/tests/api.js
View file @
29cdb212
...
...
@@ -2264,5 +2264,6 @@ ok(tmp.ubound("2") == 3, "tmp.ubound(\"2\") = " + tmp.ubound("2"));
ok
(
tmp
.
getItem
(
1
,
2
)
==
3
,
"tmp.getItem(1, 2) = "
+
tmp
.
getItem
(
1
,
2
));
ok
(
tmp
.
getItem
(
2
,
3
)
==
33
,
"tmp.getItem(2, 3) = "
+
tmp
.
getItem
(
2
,
3
));
ok
(
tmp
.
getItem
(
3
,
2
)
==
13
,
"tmp.getItem(3, 2) = "
+
tmp
.
getItem
(
3
,
2
));
ok
(
tmp
.
toArray
()
==
"2,3,12,13,22,23,32,33,42,43"
,
"tmp.toArray() = "
+
tmp
.
toArray
());
reportSuccess
();
dlls/jscript/vbarray.c
View file @
29cdb212
...
...
@@ -134,8 +134,49 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DIS
static
HRESULT
VBArray_toArray
(
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
;
jsdisp_t
*
array
;
VARIANT
*
v
;
int
i
,
size
=
1
,
ubound
,
lbound
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
vbarray
=
vbarray_this
(
vthis
);
if
(
!
vbarray
)
return
throw_type_error
(
ctx
,
ei
,
IDS_NOT_VBARRAY
,
NULL
);
for
(
i
=
1
;
i
<=
SafeArrayGetDim
(
vbarray
->
safearray
);
i
++
)
{
SafeArrayGetLBound
(
vbarray
->
safearray
,
i
,
&
lbound
);
SafeArrayGetUBound
(
vbarray
->
safearray
,
i
,
&
ubound
);
size
*=
ubound
-
lbound
+
1
;
}
hres
=
SafeArrayAccessData
(
vbarray
->
safearray
,
(
void
**
)
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
create_array
(
ctx
,
0
,
&
array
);
if
(
FAILED
(
hres
))
{
SafeArrayUnaccessData
(
vbarray
->
safearray
);
return
hres
;
}
for
(
i
=
0
;
i
<
size
;
i
++
)
{
hres
=
jsdisp_propput_idx
(
array
,
i
,
v
,
ei
,
caller
);
if
(
FAILED
(
hres
))
{
SafeArrayUnaccessData
(
vbarray
->
safearray
);
jsdisp_release
(
array
);
return
hres
;
}
v
++
;
}
SafeArrayUnaccessData
(
vbarray
->
safearray
);
if
(
retv
)
var_set_jsdisp
(
retv
,
array
);
return
S_OK
;
}
static
HRESULT
VBArray_ubound
(
script_ctx_t
*
ctx
,
vdisp_t
*
vthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment