Bug 134920
| Summary: | JSON.parse gives incorrect result for "-0 ". | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Lasse R.H. Nielsen <lrn> |
| Component: | JavaScriptCore | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Shvayka
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)