#15173 closed defect (wontfix)
dojo/cookie and NaN
Reported by: | mm | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | General | Version: | 1.7.2 |
Keywords: | Cc: | Adam Peller | |
Blocked By: | Blocking: |
Description
dojo.cookie = function(/*String*/name, /*String?*/value, /*dojo.cookieProps?*/props)
what happens if you send NaN in props.expires ? RESULT: =-1; expires=Invalid Date
or other type than number ? =-1; expires=dog
what will happen in each browser when you try to set cookie with nonsence explire ?
Please try a bit safer code. Thank you.
Change History (2)
comment:1 Changed 9 years ago by
Cc: | Adam Peller added |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:2 Changed 9 years ago by
I understand the general strategy, however dojo is quite inconsistent in this as well. Specially dealing with isNumber checks. In this case maybe we are talking about one isNaN check.
But ok.
Note: See
TracTickets for help on using
tickets.
Dojo's policy is usually to not bloat our code with argument type checking, but rather to "fail early" so that apps can notice their mistake and fix it. Explicit argument type checking penalizes apps that use the API correctly (penalizes them by slowing down load time).
I'm cc'ing Adam since it seems like he did the most recent changes to dojo/cookie, but I'm going to close this for now as wontfix. He can reopen if he disagrees.