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

Shell command completion for function properties has 'prototype' 3 times

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.1.0
    • Affects Version/s: 2.0.0
    • Component/s: Shell
    • Labels:
      None
    • Environment:
      Any
    • ALL

      In the Mongo shell, if you type v=function(){}; <Enter> v. <Tab> and then hit <Tab> 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'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 _autocomplete. So, the bug seems to be in shellAutocomplete() or one of its helper routines:

      > _autocomplete_
      [
      "v.apply(",
      "v.call(",
      "v.constructor",
      "v.hasOwnProperty(",
      "v.propertyIsEnumerable(",
      "v.prototype",
      "v.prototype",
      "v.prototype",
      "v.toLocaleString(",
      "v.toString(",
      "v.valueOf("
      ]
      >

            Assignee:
            tad Tad Marshall
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: