[SERVER-14430] Shell in interactive mode does not wait for for-loop body Created: 02/Jul/14  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.3
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Thomas Rueckstiess Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: move-sa, polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-13401 Javascript (2 issues): loop variable ... Closed
is related to SERVER-13934 Escaping of parentheses/brackets/brac... Closed
is related to SERVER-3994 Brace matching in mongo shell could b... Closed
Operating System: ALL
Participants:

 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.



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Generated at Thu Feb 08 03:34:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.