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
b67c957f
Commit
b67c957f
authored
Jan 31, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Directly return error code instead of using throw_range_error.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d487027
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
17 deletions
+11
-17
array.c
dlls/jscript/array.c
+2
-2
error.c
dlls/jscript/error.c
+0
-5
jscript.h
dlls/jscript/jscript.h
+0
-1
number.c
dlls/jscript/number.c
+5
-5
vbarray.c
dlls/jscript/vbarray.c
+4
-4
No files found.
dlls/jscript/array.c
View file @
b67c957f
...
...
@@ -149,7 +149,7 @@ static HRESULT Array_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t val
len
=
floor
(
len
);
if
(
len
!=
(
DWORD
)
len
)
return
throw_range_error
(
ctx
,
JS_E_INVALID_LENGTH
,
NULL
)
;
return
JS_E_INVALID_LENGTH
;
for
(
i
=
len
;
i
<
This
->
length
;
i
++
)
{
hres
=
jsdisp_delete_idx
(
&
This
->
dispex
,
i
);
...
...
@@ -1281,7 +1281,7 @@ static HRESULT ArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
double
n
=
get_number
(
argv
[
0
]);
if
(
n
<
0
||
!
is_int32
(
n
))
return
throw_range_error
(
ctx
,
JS_E_INVALID_LENGTH
,
NULL
)
;
return
JS_E_INVALID_LENGTH
;
hres
=
create_array
(
ctx
,
n
,
&
obj
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/error.c
View file @
b67c957f
...
...
@@ -435,11 +435,6 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j
return
error
;
}
HRESULT
throw_range_error
(
script_ctx_t
*
ctx
,
HRESULT
error
,
const
WCHAR
*
str
)
{
return
throw_error
(
ctx
,
error
,
str
,
ctx
->
range_error_constr
);
}
HRESULT
throw_reference_error
(
script_ctx_t
*
ctx
,
HRESULT
error
,
const
WCHAR
*
str
)
{
return
throw_error
(
ctx
,
error
,
str
,
ctx
->
reference_error_constr
);
...
...
dlls/jscript/jscript.h
View file @
b67c957f
...
...
@@ -312,7 +312,6 @@ HRESULT Function_get_value(script_ctx_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN;
struct
_function_code_t
*
Function_get_code
(
jsdisp_t
*
)
DECLSPEC_HIDDEN
;
#define DEFAULT_FUNCTION_VALUE {NULL, Function_value,0, Function_get_value}
HRESULT
throw_range_error
(
script_ctx_t
*
,
HRESULT
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
throw_reference_error
(
script_ctx_t
*
,
HRESULT
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
throw_regexp_error
(
script_ctx_t
*
,
HRESULT
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
throw_syntax_error
(
script_ctx_t
*
,
HRESULT
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/number.c
View file @
b67c957f
...
...
@@ -375,8 +375,8 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
if
(
FAILED
(
hres
))
return
hres
;
if
(
prec
<
0
||
prec
>
20
)
return
throw_range_error
(
ctx
,
JS_E_FRACTION_DIGITS_OUT_OF_RANGE
,
NULL
)
;
if
(
prec
<
0
||
prec
>
20
)
return
JS_E_FRACTION_DIGITS_OUT_OF_RANGE
;
}
val
=
number
->
value
;
...
...
@@ -416,8 +416,8 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
if
(
FAILED
(
hres
))
return
hres
;
if
(
prec
<
0
||
prec
>
20
)
return
throw_range_error
(
ctx
,
JS_E_FRACTION_DIGITS_OUT_OF_RANGE
,
NULL
)
;
if
(
prec
<
0
||
prec
>
20
)
return
JS_E_FRACTION_DIGITS_OUT_OF_RANGE
;
}
val
=
number
->
value
;
...
...
@@ -458,7 +458,7 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
return
hres
;
if
(
prec
<
1
||
prec
>
21
)
return
throw_range_error
(
ctx
,
JS_E_PRECISION_OUT_OF_RANGE
,
NULL
)
;
return
JS_E_PRECISION_OUT_OF_RANGE
;
}
val
=
number
->
value
;
...
...
dlls/jscript/vbarray.c
View file @
b67c957f
...
...
@@ -80,7 +80,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
return
throw_type_error
(
ctx
,
JS_E_VBARRAY_EXPECTED
,
NULL
);
if
(
argc
<
SafeArrayGetDim
(
vbarray
->
safearray
))
return
throw_range_error
(
ctx
,
JS_E_SUBSCRIPT_OUT_OF_RANGE
,
NULL
)
;
return
JS_E_SUBSCRIPT_OUT_OF_RANGE
;
indexes
=
heap_alloc
(
sizeof
(
int
)
*
argc
);
if
(
!
indexes
)
...
...
@@ -97,7 +97,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
hres
=
SafeArrayGetElement
(
vbarray
->
safearray
,
indexes
,
(
void
*
)
&
out
);
heap_free
(
indexes
);
if
(
hres
==
DISP_E_BADINDEX
)
return
throw_range_error
(
ctx
,
JS_E_SUBSCRIPT_OUT_OF_RANGE
,
NULL
)
;
return
JS_E_SUBSCRIPT_OUT_OF_RANGE
;
else
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -130,7 +130,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
hres
=
SafeArrayGetLBound
(
vbarray
->
safearray
,
dim
,
&
dim
);
if
(
hres
==
DISP_E_BADINDEX
)
return
throw_range_error
(
ctx
,
JS_E_SUBSCRIPT_OUT_OF_RANGE
,
NULL
)
;
return
JS_E_SUBSCRIPT_OUT_OF_RANGE
;
else
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -216,7 +216,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
hres
=
SafeArrayGetUBound
(
vbarray
->
safearray
,
dim
,
&
dim
);
if
(
hres
==
DISP_E_BADINDEX
)
return
throw_range_error
(
ctx
,
JS_E_SUBSCRIPT_OUT_OF_RANGE
,
NULL
)
;
return
JS_E_SUBSCRIPT_OUT_OF_RANGE
;
else
if
(
FAILED
(
hres
))
return
hres
;
...
...
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