Opened 15 years ago
Closed 15 years ago
#398 closed defect (invalid)
dojo.lang.shallowCopy has an unnessary if statement
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | General | Version: | 0.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Remove if(dojo.lang.isUndefined(ret[key]))
dojo.lang.shallowCopy = function(obj) { var ret = {}, key; for(key in obj) {ret[key] = obj[key];} return ret; } REPLACES: dojo.lang.shallowCopy = function(obj) { var ret = {}, key; for(key in obj) { if(dojo.lang.isUndefined(ret[key])) { ret[key] = obj[key]; } } return ret; }
Note: See
TracTickets for help on using
tickets.
There are a few situations (rare but there) where the isUndefined is actually necessary. Thanks for the thought though.