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

inverted value for ternary

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Core
    • 1
    • Not Needed

      I was looking to understand how queued request are stored in the new version of mongodb so I was reading the code.

      Doing so I fall on the line 115 of connect.js that looks buggy to me.

      https://github.com/mongodb/node-mongodb-native/blob/ffcd6ba324409db5b129a84d62b0b1e071b91cf6/lib/cmap/connection.js#L115

      this[kStream].destroy(typeof issue.destroy === 'boolean' ? undefined : issue.destroy);

      It's look like the value are inverted and should be written like this

      this[kStream].destroy(typeof issue.destroy === 'boolean' ? issue.destroy : undefined);

       

      There's the same issue line 131.

       

      Maybe I'm wrong but I see similar line that was written in the other way.

            Assignee:
            Unassigned Unassigned
            Reporter:
            peernohell@gmail.com Francois Lecroart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: