-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: JavaScript, Shell
-
ALL
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.