Bug 134920

Summary: JSON.parse gives incorrect result for "-0 ".
Product: WebKit Reporter: Lasse R.H. Nielsen <lrn>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ashvayka, ggaren, ross.kirsling
Priority: P2    
Version: 420+   
Hardware: Unspecified   
OS: OS X 10.7   

Lasse R.H. Nielsen
Reported 2014-07-15 00:09:31 PDT
JSON.parse("-0 ") should give the same result as JSON.parse("-0"), but where the latter correctly returns -0.0, the former returns positive 0.0.
Attachments
Alexey Shvayka
Comment 1 2019-06-10 17:53:33 PDT
This is fixed as of rev. 246299: negative zero surrounded by whitespace is parsed correctly. To prevent regressions, I am adding a few test cases to Test262: https://github.com/tc39/test262/pull/2196 (file: text-negative-zero.js)
Note You need to log in before you can comment on or make changes to this bug.