<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:04:40 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-4006] Shell command completion for function properties has &apos;prototype&apos; 3 times</title>
                <link>https://jira.mongodb.org/browse/SERVER-4006</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In the Mongo shell, if you type v=function(){}; &amp;lt;Enter&amp;gt; v. &amp;lt;Tab&amp;gt; and then hit &amp;lt;Tab&amp;gt; repeatedly, you cycle through completions of apply(, call(, constructor, hasOwnProperty(, propertyIsEnumerable(, prototype, prototype, prototype, toLocaleString(, toString( and valueOf(.  I tried arrays, objects, Dates, ISODates and NumberLongs and didn&apos;t see any others with any repetitions.  From reading the code, I see that this set of completions is coming from a JavaScript routine shellAutocomplete() in shell/utils.js, and this code sets a JavaScript variable _&lt;em&gt;autocomplete&lt;/em&gt;.  So, the bug seems to be in shellAutocomplete() or one of its helper routines:&lt;/p&gt;

&lt;p&gt;&amp;gt; _&lt;em&gt;autocomplete&lt;/em&gt;_&lt;br/&gt;
[&lt;br/&gt;
	&quot;v.apply(&quot;,&lt;br/&gt;
	&quot;v.call(&quot;,&lt;br/&gt;
	&quot;v.constructor&quot;,&lt;br/&gt;
	&quot;v.hasOwnProperty(&quot;,&lt;br/&gt;
	&quot;v.propertyIsEnumerable(&quot;,&lt;br/&gt;
	&quot;v.prototype&quot;,&lt;br/&gt;
	&quot;v.prototype&quot;,&lt;br/&gt;
	&quot;v.prototype&quot;,&lt;br/&gt;
	&quot;v.toLocaleString(&quot;,&lt;br/&gt;
	&quot;v.toString(&quot;,&lt;br/&gt;
	&quot;v.valueOf(&quot;&lt;br/&gt;
]&lt;br/&gt;
&amp;gt; &lt;/p&gt;</description>
                <environment>Any</environment>
        <key id="23179">SERVER-4006</key>
            <summary>Shell command completion for function properties has &apos;prototype&apos; 3 times</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="tad">Tad Marshall</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Oct 2011 01:15:46 +0000</created>
                <updated>Mon, 11 Jul 2016 18:34:17 +0000</updated>
                            <resolved>Mon, 28 Nov 2011 19:53:31 +0000</resolved>
                                    <version>2.0.0</version>
                                    <fixVersion>2.1.0</fixVersion>
                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="69356" author="tad" created="Mon, 28 Nov 2011 19:53:31 +0000"  >&lt;p&gt;Fixed by commit 94602bb066d104cbf1fe8bb18203147774347bfe .&lt;/p&gt;</comment>
                            <comment id="69354" author="auto" created="Mon, 28 Nov 2011 19:47:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4006&quot; title=&quot;Shell command completion for function properties has &amp;#39;prototype&amp;#39; 3 times&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4006&quot;&gt;&lt;del&gt;SERVER-4006&lt;/del&gt;&lt;/a&gt; &amp;#8211; remove duplicates from autocomplete list&lt;/p&gt;

&lt;p&gt;The logic comes up with three ways that &quot;prototype&quot; could be a&lt;br/&gt;
completion for a function name followed by a period, so just make&lt;br/&gt;
sure that we end up with only one in the final list.  Also, convert&lt;br/&gt;
tabs to spaces and fix up for code style in shellAutocomplete().&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/94602bb066d104cbf1fe8bb18203147774347bfe&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/94602bb066d104cbf1fe8bb18203147774347bfe&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="59630" author="tad" created="Tue, 11 Oct 2011 00:13:13 +0000"  >&lt;p&gt;I did some more testing, and a version of the code that I built on my machine from 1.8.3 sources showed the same issue with &apos;prototype&apos; appearing 3 times in the _&lt;em&gt;autocomplete&lt;/em&gt;_ variable.  I haven&apos;t figured out what changed from my earlier report, but it may be the version of SpiderMonkey I&apos;m using.  We could potentially see different behavior from V8.&lt;/p&gt;

&lt;p&gt;It doesn&apos;t really matter what the root cause is, because it is worth fixing and it&apos;s not hard.  readline had code to remove duplicates and linenoise could (should?) have that feature.  The JavaScript that generates the list is doing nothing to prevent duplicates and it could (should) remove them.  The bug is user-visible and easy to fix so it&apos;s worth fixing.&lt;/p&gt;</comment>
                            <comment id="59359" author="tad" created="Sun, 9 Oct 2011 18:03:00 +0000"  >&lt;p&gt;Version 1.8.4-rc1-pre- doesn&apos;t have this bug.&lt;/p&gt;

&lt;p&gt;MongoDB shell version: 1.8.4-rc1-pre-&lt;br/&gt;
&amp;gt; v=function(){}&lt;br/&gt;
function () {&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; v.&amp;lt;tab&amp;gt; // generate _&lt;em&gt;autocomplete&lt;/em&gt;_ typing &quot;v.&quot; and by hitting tab, then ctrl-u to erase&lt;br/&gt;
&amp;gt; _&lt;em&gt;autocomplete&lt;/em&gt;_&lt;br/&gt;
[&lt;br/&gt;
	&quot;v.apply(&quot;,&lt;br/&gt;
	&quot;v.call(&quot;,&lt;br/&gt;
	&quot;v.constructor&quot;,&lt;br/&gt;
	&quot;v.hasOwnProperty(&quot;,&lt;br/&gt;
	&quot;v.propertyIsEnumerable(&quot;,&lt;br/&gt;
	&quot;v.prototype&quot;, // prototype only appears in the list once&lt;br/&gt;
	&quot;v.toLocaleString(&quot;,&lt;br/&gt;
	&quot;v.toString(&quot;,&lt;br/&gt;
	&quot;v.valueOf(&quot;&lt;br/&gt;
]&lt;br/&gt;
&amp;gt; &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 28 Nov 2011 19:47:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 12 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 12 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hroovz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgenz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9285</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht0cx3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>