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
3afc444e
Commit
3afc444e
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 errors in Number functions.
parent
f89fbb9b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
jscript_En.rc
dlls/jscript/jscript_En.rc
+2
-0
number.c
dlls/jscript/number.c
+6
-12
resource.h
dlls/jscript/resource.h
+2
-0
api.js
dlls/jscript/tests/api.js
+2
-0
No files found.
dlls/jscript/jscript_En.rc
View file @
3afc444e
...
@@ -22,9 +22,11 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
...
@@ -22,9 +22,11 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
STRINGTABLE DISCARDABLE
{
{
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_NOT_DATE "'[object]' is not a date object"
IDS_NOT_DATE "'[object]' is not a date object"
IDS_NOT_NUM "Number expected"
IDS_NOT_BOOL "Boolean object expected"
IDS_NOT_BOOL "Boolean object expected"
IDS_INVALID_LENGTH "Array length must be a finite positive integer"
IDS_INVALID_LENGTH "Array length must be a finite positive integer"
}
}
dlls/jscript/number.c
View file @
3afc444e
...
@@ -54,10 +54,8 @@ static HRESULT Number_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
...
@@ -54,10 +54,8 @@ static HRESULT Number_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
if
(
!
is_class
(
dispex
,
JSCLASS_NUMBER
))
{
if
(
!
is_class
(
dispex
,
JSCLASS_NUMBER
))
FIXME
(
"throw TypeError
\n
"
);
return
throw_type_error
(
dispex
->
ctx
,
ei
,
IDS_NOT_NUM
,
NULL
);
return
E_FAIL
;
}
number
=
(
NumberInstance
*
)
dispex
;
number
=
(
NumberInstance
*
)
dispex
;
...
@@ -66,10 +64,8 @@ static HRESULT Number_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
...
@@ -66,10 +64,8 @@ static HRESULT Number_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
if
(
radix
<
2
||
radix
>
36
)
{
if
(
radix
<
2
||
radix
>
36
)
FIXME
(
"throw TypeError
\n
"
);
return
throw_type_error
(
dispex
->
ctx
,
ei
,
IDS_INVALID_CALL_ARG
,
NULL
);
return
E_FAIL
;
}
}
}
if
(
V_VT
(
&
number
->
num
)
==
VT_I4
)
if
(
V_VT
(
&
number
->
num
)
==
VT_I4
)
...
@@ -208,10 +204,8 @@ static HRESULT Number_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR
...
@@ -208,10 +204,8 @@ static HRESULT Number_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR
{
{
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
if
(
!
is_class
(
dispex
,
JSCLASS_NUMBER
))
{
if
(
!
is_class
(
dispex
,
JSCLASS_NUMBER
))
FIXME
(
"throw TypeError
\n
"
);
return
throw_type_error
(
dispex
->
ctx
,
ei
,
IDS_NOT_NUM
,
NULL
);
return
E_FAIL
;
}
if
(
retv
)
{
if
(
retv
)
{
NumberInstance
*
number
=
(
NumberInstance
*
)
dispex
;
NumberInstance
*
number
=
(
NumberInstance
*
)
dispex
;
...
...
dlls/jscript/resource.h
View file @
3afc444e
...
@@ -18,8 +18,10 @@
...
@@ -18,8 +18,10 @@
#include <windef.h>
#include <windef.h>
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_NO_PROPERTY 0x01B6
#define IDS_NO_PROPERTY 0x01B6
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_NOT_DATE 0x138E
#define IDS_NOT_DATE 0x138E
#define IDS_NOT_NUM 0x1389
#define IDS_NOT_BOOL 0x1392
#define IDS_NOT_BOOL 0x1392
#define IDS_INVALID_LENGTH 0x13A5
#define IDS_INVALID_LENGTH 0x13A5
dlls/jscript/tests/api.js
View file @
3afc444e
...
@@ -1302,5 +1302,7 @@ exception_test(function() {Array(-3);}, "RangeError");
...
@@ -1302,5 +1302,7 @@ exception_test(function() {Array(-3);}, "RangeError");
exception_test
(
function
()
{
arr
.
toString
=
Boolean
.
prototype
.
toString
;
arr
.
toString
();},
"TypeError"
);
exception_test
(
function
()
{
arr
.
toString
=
Boolean
.
prototype
.
toString
;
arr
.
toString
();},
"TypeError"
);
exception_test
(
function
()
{
date
.
setTime
();},
"TypeError"
);
exception_test
(
function
()
{
date
.
setTime
();},
"TypeError"
);
exception_test
(
function
()
{
arr
.
test
();},
"TypeError"
);
exception_test
(
function
()
{
arr
.
test
();},
"TypeError"
);
exception_test
(
function
()
{
arr
.
toString
=
Number
.
prototype
.
toString
;
arr
.
toString
();},
"TypeError"
);
exception_test
(
function
()
{(
new
Number
(
3
)).
toString
(
1
);},
"TypeError"
);
reportSuccess
();
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