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
38f6eb34
Commit
38f6eb34
authored
Jun 22, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jun 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Properly handle passing undefined value to Number.toString in ES5+ mode.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
3d04d052
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
number.c
dlls/jscript/number.c
+1
-1
api.js
dlls/jscript/tests/api.js
+1
-0
es5.js
dlls/mshtml/tests/es5.js
+3
-0
No files found.
dlls/jscript/number.c
View file @
38f6eb34
...
...
@@ -239,7 +239,7 @@ static HRESULT Number_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
if
(
FAILED
(
hres
))
return
hres
;
if
(
argc
)
{
if
(
argc
&&
(
ctx
->
version
<
SCRIPTLANGUAGEVERSION_ES5
||
!
is_undefined
(
argv
[
0
]))
)
{
hres
=
to_int32
(
ctx
,
argv
[
0
],
&
radix
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/tests/api.js
View file @
38f6eb34
...
...
@@ -2709,6 +2709,7 @@ testException(function() {Number.prototype.toFixed.call(arr);}, "E_NOT_NUM");
testException
(
function
()
{
Number
.
prototype
.
toLocaleString
.
call
(
arr
);},
"E_NOT_NUM"
);
testException
(
function
()
{
Number
.
prototype
.
toLocaleString
.
call
(
null
);},
"E_NOT_NUM"
);
testException
(
function
()
{(
new
Number
(
3
)).
toString
(
1
);},
"E_INVALID_CALL_ARG"
);
testException
(
function
()
{(
new
Number
(
3
)).
toString
(
undefined
);},
"E_INVALID_CALL_ARG"
);
testException
(
function
()
{(
new
Number
(
3
)).
toFixed
(
21
);},
"E_FRACTION_DIGITS_OUT_OF_RANGE"
);
testException
(
function
()
{(
new
Number
(
1
)).
toPrecision
(
0
);},
"E_PRECISION_OUT_OF_RANGE"
);
if
(
invokeVersion
<
2
)
...
...
dlls/mshtml/tests/es5.js
View file @
38f6eb34
...
...
@@ -1127,6 +1127,9 @@ sync_test("toString", function() {
obj
=
Object
.
create
(
Number
.
prototype
);
tmp
=
Object
.
prototype
.
toString
.
call
(
obj
);
ok
(
tmp
===
"[object Object]"
,
"toString.call(Object.create(Number.prototype)) = "
+
tmp
);
tmp
=
(
new
Number
(
303
)).
toString
(
undefined
);
ok
(
tmp
===
"303"
,
"Number 303 toString(undefined) = "
+
tmp
);
});
sync_test
(
"bind"
,
function
()
{
...
...
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