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
531f8336
Commit
531f8336
authored
Oct 16, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added infinity and nan handling to str_to_number.
parent
4f6f8ef2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
jsutils.c
dlls/jscript/jsutils.c
+15
-15
lang.js
dlls/jscript/tests/lang.js
+7
-0
No files found.
dlls/jscript/jsutils.c
View file @
531f8336
...
...
@@ -246,26 +246,26 @@ static HRESULT str_to_number(BSTR str, VARIANT *ret)
while
(
isspaceW
(
*
ptr
))
ptr
++
;
if
(
*
ptr
==
'-'
)
{
neg
=
TRUE
;
ptr
++
;
}
else
if
(
*
ptr
==
'+'
)
{
ptr
++
;
}
if
(
!
strncmpW
(
ptr
,
infinityW
,
sizeof
(
infinityW
)
/
sizeof
(
WCHAR
)))
{
ptr
+=
sizeof
(
infinityW
)
/
sizeof
(
WCHAR
);
while
(
*
ptr
&&
isspaceW
(
*
ptr
))
ptr
++
;
if
(
*
ptr
)
{
FIXME
(
"NaN
\n
"
);
return
E_NOTIMPL
;
}
FIXME
(
"inf
\n
"
);
return
E_NOTIMPL
;
if
(
*
ptr
)
num_set_nan
(
ret
);
else
num_set_inf
(
ret
,
!
neg
);
return
S_OK
;
}
if
(
*
ptr
==
'-'
)
{
neg
=
TRUE
;
ptr
++
;
}
else
if
(
*
ptr
==
'+'
)
{
ptr
++
;
}
else
if
(
*
ptr
==
'0'
&&
ptr
[
1
]
==
'x'
)
{
if
(
*
ptr
==
'0'
&&
ptr
[
1
]
==
'x'
)
{
DWORD
l
=
0
;
ptr
+=
2
;
...
...
@@ -313,8 +313,8 @@ static HRESULT str_to_number(BSTR str, VARIANT *ret)
ptr
++
;
if
(
*
ptr
)
{
FIXME
(
"NaN
\n
"
);
return
E_NOTIMPL
;
num_set_nan
(
ret
);
return
S_OK
;
}
if
(
neg
)
...
...
dlls/jscript/tests/lang.js
View file @
531f8336
...
...
@@ -813,4 +813,11 @@ ok((Infinity < 2) === false, "(Infinity < 2) !== false");
ok
((
Infinity
>
2
)
===
true
,
"(Infinity > 2) !== true"
);
ok
((
-
Infinity
<
2
)
===
true
,
"(-Infinity < 2) !== true"
);
ok
(
isNaN
(
+
"test"
)
===
true
,
"isNaN(+'test') !== true"
);
ok
(
isNaN
(
+
"123t"
)
===
true
,
"isNaN(+'123t') !== true"
);
ok
(
isNaN
(
+
"Infinity x"
)
===
true
,
"isNaN(+'Infinity x') !== true"
);
ok
(
+
"Infinity"
===
Infinity
,
"+'Infinity' !== Infinity"
);
ok
(
+
" Infinity "
===
Infinity
,
"+' Infinity ' !== Infinity"
);
ok
(
+
"-Infinity"
===
-
Infinity
,
"+'-Infinity' !== -Infinity"
);
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