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

Shell in interactive mode does not wait for for-loop body

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial - P5 Trivial - P5
    • None
    • 2.6.3
    • Shell
    • ALL

    Description

      If the shell is in interactive mode, writing

      for (var i = 0; i < 10; i++)

      will prematurely send the line to V8 for execution, which then returns

      SyntaxError: Unexpected end of input

      because of the missing body.

      However, if one writes

      for (var i = 0; i < 10; i++) {    // notice open { at end

      it will correctly prompt for the body of the loop.

      The shell should detect the missing body and also wait for the next statement.

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: