[SERVER-4602] Bonus (bogus, leftover) global variables visible in shell's autocomplete Created: 03/Jan/12  Updated: 11/Jul/16  Resolved: 11/Nov/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.2.0

Type: Bug Priority: Trivial - P5
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

There are a few global JavaScript variables being set by code that runs in the shell that shouldn't be there. You can see them if you try to autocomplete an empty line in the shell by hitting tab at an empty prompt; one symbol may not even be a variable, but it shows up in the list if you generate it twice in a row. You can see the list of everything global (and not hidden) by hitting tab at an empty prompt in a fresh copy of the shell, then typing "_autocomplete_".

a0: "foo"
b0: "bar"
i: "return"
return: ??? not sure, but it's in the list

a0, b0 and i are just missing "var" to declare them local to the functions they are used in. I haven't dug into where "return" is coming from yet.



 Comments   
Comment by Gianfranco Palumbo [ 09/Nov/13 ]

this seems been merged into master and 2.2.2-rc0

Comment by auto [ 03/Jan/12 ]

Author:

{u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-4602 use 'var' to prevent accidental global variables

Fixes unintended 'a0', 'b0' and 'i' global variables in the shell.
Branch: master
https://github.com/mongodb/mongo/commit/aed4463a413dc51fbcc8405fbbadba66337831f1

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