Closed Bug 1668660 Opened 5 years ago Closed 5 years ago

JSON reader not able to display max and min values of signed 64 bit integers

Categories

(DevTools :: JSON Viewer, defect)

Firefox 81
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1431808

People

(Reporter: hsinmao, Unassigned)

Details

User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1

Steps to reproduce:

I was reading a JSON from within the browser, the values were supposed to be Long.MAX_VALUE and MIN_VALUE. I thought I found a bug in my own code however after comparing the raw data to the JSON formatted views in Firefox 81, I saw that -9223372036854775807 and 9223372036854775808 in the raw data view were being displayed as +/-9223372036854776000 respectively in the JSON view.

Actual results:

I almost had a panic attack thinking I had shipped broken code to prod.

Expected results:

The JSON viewer should be displaying 64bit signed integers correctly.

JSON viewer parses the input JSON file with ECMAScript function JSON.parse,

in ECMAScript, numbers are double-precision 64-bit binary format IEEE 754-2019 value,
and it cannot represent 64-bit signed integer max value.

https://tc39.es/ecma262/#sec-terms-and-definitions-number-value

Component: Untriaged → JSON Viewer
Product: Firefox → DevTools
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.