Using bigint in Code's scope throws when inspected

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Minor - P4
    • None
    • Affects Version/s: bson-4.7.2, bson-5.0.1
    • Component/s: BSON
    • Not Needed
    • None
    • 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?
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Neal Beeken
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: