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

Using bigint in Code's scope throws when inspected

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: bson-4.7.2, bson-5.0.1
    • Component/s: BSON
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      What problem are you facing?

      Using a bigint in the Code's scope field causes an exception when inspected. This would also effect DBRef's field property if it was included in the inspect string.

      Steps to reproduce?

      > new Code(function a() {}, { a: 1n })
      Uncaught TypeError: Do not know how to serialize a BigInt
          at JSON.stringify (<anonymous>)
          at Code.inspect (/Users/neal/code/drivers/js/bson/lib/bson.cjs:653:89)
          at [nodejs.util.inspect.custom] (/Users/neal/code/drivers/js/bson/lib/bson.cjs:649:21)
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: