Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18978 closed defect (fixed)

request/util/deepCopy does not handle Date objects correctly

Reported by: Michael Schall Owned by: dylans <dylan@…>
Priority: high Milestone: 1.13
Component: Core Version: 1.12.1
Keywords: Cc:
Blocked By: Blocking:

Description

When calling util.deepCopy properties of type Date do not get copied.

example: http://plnkr.co/edit/ebYbu9nQ5m3rAbyQbMP1?p=preview

Change History (3)

comment:1 Changed 3 years ago by Michael Schall

Here is a patch. I will try and create PR soon.

  • request/util.js

     
    1414                                sval = source[name];
    1515                        if(tval !== sval){
    1616                                if(tval && typeof tval === 'object' && sval && typeof sval === 'object'){
    17                                         exports.deepCopy(tval, sval);
     17                                        if(sval instanceof Date){
     18                                                target[name] = new Date(sval);
     19                                        }else{
     20                                                exports.deepCopy(tval, sval);
     21                                        }
    1822                                }else{
    1923                                        target[name] = sval;
    2024                                }

comment:2 Changed 3 years ago by dylans <dylan@…>

Owner: set to dylans <dylan@…>
Resolution: fixed
Status: newclosed

In 2aa295a/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:3 Changed 3 years ago by dylan

Component: GeneralCore
Milestone: tbd1.13
Priority: undecidedhigh
Note: See TracTickets for help on using tickets.