Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20774

Force assert() to accept only booleans

    XMLWordPrintable

    Details

      Description

      Currently assert() will accept non-boolean values, and tests them for truthyness/falsiness. Sometimes this is desirable, but it may permit problems such as mistakenly testing an object, or a function itself (rather than its return value), and so on.

      It would be better if assert() only accepted boolean values, and situations where the author wants to test a non-boolean value should explicitly declare that by using assert.truthy() and/or assert.falsy() helper functions.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-stm Backlog - Server Tooling and Methods (STM)
              Reporter:
              kevin.pulo Kevin Pulo
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: