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
10a11d53
Commit
10a11d53
authored
Oct 18, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscrpt: Added VBScript.lbound() implementation.
parent
17fc6415
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
+34
-2
jscript_En.rc
dlls/jscript/jscript_En.rc
+1
-0
resource.h
dlls/jscript/resource.h
+1
-0
api.js
dlls/jscript/tests/api.js
+6
-0
vbarray.c
dlls/jscript/vbarray.c
+26
-2
No files found.
dlls/jscript/jscript_En.rc
View file @
10a11d53
...
...
@@ -24,6 +24,7 @@ STRINGTABLE
{
IDS_TO_PRIMITIVE "Error converting object to primitive type"
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_SUBSCRIPT_OUT_OF_RANGE "Subscript out of range"
IDS_CREATE_OBJ_ERROR "Automation server can't create object"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_UNSUPPORTED_ACTION "Object doesn't support this action"
...
...
dlls/jscript/resource.h
View file @
10a11d53
...
...
@@ -20,6 +20,7 @@
#define IDS_TO_PRIMITIVE 0x0001
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_SUBSCRIPT_OUT_OF_RANGE 0x0009
#define IDS_CREATE_OBJ_ERROR 0x01AD
#define IDS_NO_PROPERTY 0x01B6
#define IDS_UNSUPPORTED_ACTION 0x01BD
...
...
dlls/jscript/tests/api.js
View file @
10a11d53
...
...
@@ -1901,6 +1901,9 @@ exception_test(function() {new null;}, "TypeError", -2146823281);
exception_test
(
function
()
{
new
nullDisp
;},
"TypeError"
,
-
2146827850
);
exception_test
(
function
()
{
new
VBArray
();},
"TypeError"
,
-
2146823275
);
exception_test
(
function
()
{
new
VBArray
(
new
VBArray
(
createArray
()));},
"TypeError"
,
-
2146823275
);
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
);
function
testThisExcept
(
func
,
number
)
{
exception_test
(
function
()
{
func
.
call
(
new
Object
())},
"TypeError"
,
number
);
...
...
@@ -2250,5 +2253,8 @@ ok(String.length == 1, "String.length = " + String.length);
var
tmp
=
new
VBArray
(
createArray
());
tmp
=
new
VBArray
(
VBArray
(
createArray
()));
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
));
reportSuccess
();
dlls/jscript/vbarray.c
View file @
10a11d53
...
...
@@ -61,8 +61,32 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DI
static
HRESULT
VBArray_lbound
(
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
dim
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
vbarray
=
vbarray_this
(
vthis
);
if
(
!
vbarray
)
return
throw_type_error
(
ctx
,
ei
,
IDS_NOT_VBARRAY
,
NULL
);
if
(
arg_cnt
(
dp
))
{
hres
=
to_int32
(
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
dim
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
dim
=
1
;
hres
=
SafeArrayGetLBound
(
vbarray
->
safearray
,
dim
,
&
dim
);
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
)
num_set_val
(
retv
,
dim
);
return
S_OK
;
}
static
HRESULT
VBArray_toArray
(
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