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
b9a57de0
Commit
b9a57de0
authored
Mar 21, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use parse_decimal for parsing JSON numeric literals starting with 0.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9240ed58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
json.c
dlls/jscript/json.c
+4
-11
api.js
dlls/jscript/tests/api.js
+4
-1
No files found.
dlls/jscript/json.c
View file @
b9a57de0
...
...
@@ -261,19 +261,12 @@ static HRESULT parse_json_value(json_parse_ctx_t *ctx, jsval_t *r)
skip_spaces
(
ctx
);
}
if
(
!
isdigitW
(
*
ctx
->
ptr
))
if
(
*
ctx
->
ptr
==
'0'
&&
ctx
->
ptr
+
1
<
ctx
->
end
&&
isdigitW
(
ctx
->
ptr
[
1
]
))
break
;
if
(
*
ctx
->
ptr
==
'0'
)
{
ctx
->
ptr
++
;
n
=
0
;
if
(
is_identifier_char
(
*
ctx
->
ptr
))
break
;
}
else
{
hres
=
parse_decimal
(
&
ctx
->
ptr
,
ctx
->
end
,
&
n
);
if
(
FAILED
(
hres
))
return
hres
;
}
hres
=
parse_decimal
(
&
ctx
->
ptr
,
ctx
->
end
,
&
n
);
if
(
FAILED
(
hres
))
break
;
*
r
=
jsval_number
(
sign
*
n
);
return
S_OK
;
...
...
dlls/jscript/tests/api.js
View file @
b9a57de0
...
...
@@ -1887,7 +1887,10 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN");
[
"[false,{},{
\"
x
\"
: []}]"
,
[
false
,{},{
x
:[]}]],
[
"0"
,
0
],
[
"- 1"
,
-
1
],
[
"1e2147483648"
,
Infinity
]
[
"1e2147483648"
,
Infinity
],
[
"0.5"
,
0.5
],
[
"0e5"
,
0
],
[
".5"
,
0.5
]
];
function
json_cmp
(
x
,
y
)
{
...
...
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