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
ec769d2d
Commit
ec769d2d
authored
Dec 04, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Correctly handle NaN in to_integer.
parent
efda5561
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
jsutils.c
dlls/jscript/jsutils.c
+6
-2
api.js
dlls/jscript/tests/api.js
+2
-0
No files found.
dlls/jscript/jsutils.c
View file @
ec769d2d
...
...
@@ -449,10 +449,14 @@ HRESULT to_integer(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret)
if
(
FAILED
(
hres
))
return
hres
;
if
(
V_VT
(
&
num
)
==
VT_I4
)
if
(
V_VT
(
&
num
)
==
VT_I4
)
{
*
ret
=
num
;
else
}
else
if
(
isnan
(
V_R8
(
&
num
)))
{
V_VT
(
ret
)
=
VT_I4
;
V_I4
(
ret
)
=
0
;
}
else
{
num_set_val
(
ret
,
V_R8
(
&
num
)
>=
0
.
0
?
floor
(
V_R8
(
&
num
))
:
-
floor
(
-
V_R8
(
&
num
)));
}
return
S_OK
;
}
...
...
dlls/jscript/tests/api.js
View file @
ec769d2d
...
...
@@ -231,6 +231,8 @@ tmp = "abc".charAt(-1);
ok
(
tmp
===
""
,
"'abc',charAt(-1) = "
+
tmp
);
tmp
=
"abc"
.
charAt
(
0
,
2
);
ok
(
tmp
===
"a"
,
"'abc',charAt(0.2) = "
+
tmp
);
tmp
=
"abc"
.
charAt
(
NaN
);
ok
(
tmp
===
"a"
,
"'abc',charAt(NaN) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
0
);
ok
(
tmp
===
0x61
,
"'abc'.charCodeAt(0) = "
+
tmp
);
...
...
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