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

Object.extend should handle Date objects

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • 31

      Expected:

      > Object.extend({}, {d: new Date()}).d
      ISODate("2022-02-04T18:37:47.961Z")
      

      Actual:

      > Object.extend({}, {d: new Date()}, true).d
      uncaught exception: TypeError: this.getTime is not a function :
      Date.prototype.tojson@src/mongo/shell/types.js:44:9
      shellPrintHelper@src/mongo/shell/utils.js:682:15
      @(shell2):1:1
      

      I noticed and fixed this on 5.3 while doing SERVER-59163, but I think we should backport it too.

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: