-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
util: Format negative zero as '-0' #6550
Conversation
Thank you for contributing this pull request! Here are a few pointers to make sure your submission will be considered for inclusion. The following commiters were not found in the CLA:
You can fix all these things without opening another issue. Please see CONTRIBUTING.md for more information |
Seems good to me at first glance. You'll need to add a test, and sign the CLA. |
Thanks, have signed the CLA |
Format negative zero as '-0' instead of as '0', as it does not behave identically to positive zero. ((-0).toString() still returns '0' as required by ES5 9.8.1.2). Fixes nodejs#6548
@isaacs @tjfontaine et all. What do you guys think? Bug fix and hence v0.10 branch, or new functionality and hence master branch? I could see it going either way really. |
I'd love to see it in v0.10, but I should point out that Chromium and Firebug format -0 as '0' so it's hard for me to claim that the existing behaviour is actually 'wrong' per se. |
@divec Since when can zero be negative? |
Since 1985. |
@juliangruber thx for clarification |
So it looks like the Chromium guys are moving ahead with this one: https://codereview.chromium.org/82553008/ I'm kinda leaning towards master branch at this point, but not really for any particular reason. |
It is master branch. Although it's extremely unlikely that someone would depend on it, it's not a bugfix, and it changes behaviour of |
Format negative zero as '-0' instead of as '0', as it does not behave
identically to positive zero. ((-0).toString() still returns '0' as
required by ES5 9.8.1.2).
Fixes #6548