Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#399 closed defect (invalid)

dojo.io.cookie.setObjectCookie

Reported by: rfa@… Owned by: anonymous
Priority: lowest Milestone:
Component: General Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

Remove if(prop == null) {delete cookie[prop];} it is not needed and will never will be true. a primitive string will never equal the null object.

for(var prop in obj) {
  if (typeof obj[prop] == "string" || typeof obj[prop] == "number") 
    {cookie[prop] = obj[prop];
}

Replaces:

for(var prop in obj) {
  if (prop == null) {
    delete cookie[prop];
  } else if (typeof obj[prop] == "string" || typeof obj[prop] == "number") {
    cookie[prop] = obj[prop];
  }
}

Change History (3)

comment:1 Changed 13 years ago by anonymous

Milestone: 0.3.1

comment:2 Changed 13 years ago by Tom Trenka

Resolution: invalid
Status: newclosed

Like the previous bug report, there are rare situations where the condition might actually be met.

comment:3 Changed 12 years ago by (none)

Milestone: 0.3.1

Milestone 0.3.1 deleted

Note: See TracTickets for help on using tickets.