-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: BSON, Spec Test Coverage
What is the feature/improvement you would like?
The JS BSON library uses a custom float parser likely for legacy reasons that no longer apply. It prevents using NaN's with payloads, we should adopt the JS native APIs that deal with 64bit floats to preserve the most intact values.
acceptance criteria
- Remove float_parser.ts and usage of the APIs it exports
- Remove unused readIEEE754
- Replace writeIEEE754 with Buffer#writeDoubleLE(value[, offset])
testing expectations
- Unskip "NaN with payload" spec test
- Add manual round trip tests for JS special values:
- Infinity
- -Infinity
- NaN
- 0
- -0 // Note: you have to use Object.is to test for this value
- Number.EPSILON
assumptions
- No-op: browser tests will cover the buffer shim and nodejs behavior