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

Prepare jstest corpus to be run in strict mode without top-level IIFEs

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • 166

      Part of the transition to using es modules for all tests in the jstest corpus includes removing top-level IIFEs and running all tests implicitly in strict mode. This may challenge some assumptions in existing tests, particularly in assuming that:

      • variables can be assigned without first declaring them (no-undef)
      • variables declared with var are permitted to shadow "global" variables (such as rs, or symbols which are "load"ed into the global scope like isMongos)

      As part of my local testing when converting all tests to modules, I enabled a few additional eslint rules and put this patch together. In some cases I have also removed duplicate logic (e.g. reusing FixtureHelpers to determine the fixture type)

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: