Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3630

Remove float_parser.ts from JS BSON

    • 3
    • Not Needed

      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

            Assignee:
            aditi.khare@mongodb.com Aditi Khare
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: