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

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

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.6.3
    • Component/s: Shell
    • Labels:
    • ALL

      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.

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

              Created:
              Updated: