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

Escaping double quote in string within braces triggers an end of input

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide
      • Open MongoDB shell
      • Open a curly bracket : "{", and hit enter
      • "..." appears for you to continue your command
      • Create the following variable quote: var quote="\"";
      • Hit enter to continue your command
        --> SyntaxError

      But if you change var quote="\""; by var quote=" \""; it will work and let you finish your command and close your bracket.

      Show
      Open MongoDB shell Open a curly bracket : "{", and hit enter "..." appears for you to continue your command Create the following variable quote: var quote="\""; Hit enter to continue your command --> SyntaxError But if you change var quote="\""; by var quote=" \""; it will work and let you finish your command and close your bracket.

      Description

      If you want to use double quotes in a string, you just have to escape it: \"
      But if you insert this escaped character right after the beginning of a string when you are within curly brackets block, it will trigger an error:
      "SyntaxError: Unexpected end of input"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-stm Backlog - Server Tooling and Methods (STM)
              Reporter:
              Thematrixme Maxime Darçot
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: