inverted value for ternary

XMLWordPrintableJSON

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

      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
              Reporter:
              Francois Lecroart
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: