Cannot override prototype members of DB type in javascript shell.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: JavaScript, Shell
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the shell, when connected to a databse, the following actual behavior occurs:

      > DB.prototype.x = 1
      1
      > db.x
      1
      > db.x = 2
      2
      > db.x
      1
      

      The expected behavior differs in that the last db.x examination should return 2, though DB.prototype.x should continue to return 1. Instances of DB aren't properly respecting prototype overriding behavior.

      For comparison,

      > function Y() {}
      > Y.prototype.y = 1
      1
      > y = new Y();
      { "y" : 1 }
      > y.y
      1
      > y.y = 2
      2
      > y.y
      2
      > Y.prototype.y
      1
      > 
      

      Note that assigning to y.y hides the prototypical value Y.prototype.y, but does not replace it.

              Assignee:
              DO NOT USE - Backlog - Platform Team
              Reporter:
              Andy Schwerin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: