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

Int32 constructor should coerce its argument

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • bson-4.5.4
    • BSON
    • Not Needed

    Description

      The Int32 constructor should coerce its argument immediately to int32, so that e.g. Int32(-(2**40)).valueOf() === 0 instead of Int32(-(2**40)).valueOf() === -(2**40). This makes it consistent with e.g. Long, and makes Int32 match what is being serialized when encoding as BSON.

      AC

      • Make sure the behavior matches what is described above
      • Test numbers outside the range of Int32, positive and negative

      Attachments

        Issue Links

          Activity

            People

              daria.pardue@mongodb.com Daria Pardue
              anna.henningsen@mongodb.com Anna Henningsen
              Grace Chong Grace Chong
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: