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
41d7f8fc
Commit
41d7f8fc
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.getItem() implementation.
parent
2f460788
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
api.js
dlls/jscript/tests/api.js
+5
-0
vbarray.c
dlls/jscript/vbarray.c
+35
-2
No files found.
dlls/jscript/tests/api.js
View file @
41d7f8fc
...
...
@@ -1904,6 +1904,8 @@ exception_test(function() {new VBArray(new VBArray(createArray()));}, "TypeError
exception_test
(
function
()
{(
new
VBArray
(
createArray
())).
lbound
(
"aaa"
);},
"RangeError"
,
-
2146828279
);
exception_test
(
function
()
{(
new
VBArray
(
createArray
())).
lbound
(
3
);},
"RangeError"
,
-
2146828279
);
exception_test
(
function
()
{
tmp
=
new
Object
();
tmp
.
lb
=
VBArray
.
prototype
.
lbound
;
tmp
.
lb
();},
"TypeError"
,
-
2146823275
);
exception_test
(
function
()
{
tmp
=
new
Object
();
tmp
.
lb
=
VBArray
.
prototype
.
lbound
;
tmp
.
lb
();},
"TypeError"
,
-
2146823275
);
exception_test
(
function
()
{(
new
VBArray
(
createArray
())).
getItem
(
3
);},
"RangeError"
,
-
2146828279
);
function
testThisExcept
(
func
,
number
)
{
exception_test
(
function
()
{
func
.
call
(
new
Object
())},
"TypeError"
,
number
);
...
...
@@ -2259,5 +2261,8 @@ 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
));
ok
(
tmp
.
ubound
()
==
4
,
"tmp.ubound() = "
+
tmp
.
ubound
());
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
));
reportSuccess
();
dlls/jscript/vbarray.c
View file @
41d7f8fc
...
...
@@ -63,8 +63,41 @@ static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
static
HRESULT
VBArray_getItem
(
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
;
int
i
,
*
indexes
,
size
;
VARIANT
out
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
vbarray
=
vbarray_this
(
vthis
);
if
(
!
vbarray
)
return
throw_type_error
(
ctx
,
ei
,
IDS_NOT_VBARRAY
,
NULL
);
size
=
arg_cnt
(
dp
);
if
(
size
<
SafeArrayGetDim
(
vbarray
->
safearray
))
return
throw_range_error
(
ctx
,
ei
,
IDS_SUBSCRIPT_OUT_OF_RANGE
,
NULL
);
indexes
=
heap_alloc
(
sizeof
(
int
)
*
size
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
hres
=
to_int32
(
ctx
,
get_arg
(
dp
,
i
),
ei
,
indexes
+
i
);
if
(
FAILED
(
hres
))
{
heap_free
(
indexes
);
return
hres
;
}
}
hres
=
SafeArrayGetElement
(
vbarray
->
safearray
,
indexes
,
(
void
*
)
&
out
);
heap_free
(
indexes
);
if
(
hres
==
DISP_E_BADINDEX
)
return
throw_range_error
(
ctx
,
ei
,
IDS_SUBSCRIPT_OUT_OF_RANGE
,
NULL
);
else
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
hres
=
VariantCopy
(
retv
,
&
out
);
return
hres
;
}
static
HRESULT
VBArray_lbound
(
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