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

Shadowing declaration of 'version' in jstest

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • ALL
    • Service Arch 2023-12-25, Service Arch 2024-01-08, Service Arch 2024-01-22, Service Arch 2024-02-05, Service Arch 2024-02-19
    • 153

    Description

      We recently had an issue where a jstest introduced the following code : 

      const version = db.version().split('.');

      Which resulted in 

      ReferenceError: can't access lexical declaration 'version' before initialization

      (see this comment for more details)

      This seems to be caused because globalThis.connect uses version() instead of globalThis.version().

      We should fix this by calling globalThis.version() here instead.

       

      Attachments

        Activity

          People

            matt.broadstone@mongodb.com Matt Broadstone
            mathis.bessa@mongodb.com Mathis Bessa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: