Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bd87f97e
Commit
bd87f97e
authored
Jul 20, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Throw range errors in Array functions.
parent
469b5972
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
array.c
dlls/jscript/array.c
+4
-8
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
+1
-0
No files found.
dlls/jscript/array.c
View file @
bd87f97e
...
...
@@ -74,10 +74,8 @@ static HRESULT Array_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
else
len
=
floor
(
V_R8
(
&
num
));
if
(
len
!=
(
DWORD
)
len
)
{
FIXME
(
"Throw RangeError
\n
"
);
return
E_FAIL
;
}
if
(
len
!=
(
DWORD
)
len
)
return
throw_range_error
(
dispex
->
ctx
,
ei
,
IDS_INVALID_LENGTH
,
NULL
);
for
(
i
=
len
;
i
<
This
->
length
;
i
++
)
{
hres
=
jsdisp_delete_idx
(
dispex
,
i
);
...
...
@@ -850,10 +848,8 @@ static HRESULT ArrayConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISP
case
DISPATCH_METHOD
:
case
DISPATCH_CONSTRUCT
:
{
if
(
arg_cnt
(
dp
)
==
1
&&
V_VT
((
arg_var
=
get_arg
(
dp
,
0
)))
==
VT_I4
)
{
if
(
V_I4
(
arg_var
)
<
0
)
{
FIXME
(
"throw RangeError
\n
"
);
return
E_FAIL
;
}
if
(
V_I4
(
arg_var
)
<
0
)
return
throw_range_error
(
dispex
->
ctx
,
ei
,
IDS_INVALID_LENGTH
,
NULL
);
hres
=
create_array
(
dispex
->
ctx
,
V_I4
(
arg_var
),
&
obj
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/jscript_En.rc
View file @
bd87f97e
...
...
@@ -23,4 +23,5 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_NOT_DATE "'[object]' is not a date object"
IDS_INVALID_LENGTH "Array length must be a finite positive integer"
}
dlls/jscript/resource.h
View file @
bd87f97e
...
...
@@ -19,3 +19,4 @@
#include <windef.h>
#define IDS_NOT_DATE 0x138E
#define IDS_INVALID_LENGTH 0x13A5
dlls/jscript/tests/api.js
View file @
bd87f97e
...
...
@@ -1298,5 +1298,6 @@ function exception_test(func, type) {
ok
(
ret
===
type
,
"Exception test, ret = "
+
ret
+
", expected "
+
type
+
". Executed function: "
+
func
.
toString
());
}
exception_test
(
function
()
{
arr
.
toString
=
Date
.
prototype
.
toString
;
arr
.
toString
();},
"TypeError"
);
exception_test
(
function
()
{
Array
(
-
3
);},
"RangeError"
);
reportSuccess
();
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