#1171 closed defect (fixed)
dojo.string.substituteParams can't substitute 0 or "0"
Reported by: | Owned by: | Adam Peller | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Text | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo.string.substituteParams has the following code:
return map[key] || dojo.raise("Substitution not found: " + key);
This means that if you do something like:
dojo.string.substituteParams("You scored a %{score}", {score: 0});
it raises an exception.
Perhaps this would be more correct:
if (dojo.lang.isUndefined(map[key])) { dojo.raise("Substitution not found: " + key); } return map[key];
Change History (3)
comment:1 Changed 15 years ago by
Milestone: | → 0.4 |
---|---|
Owner: | changed from psowden to Adam Peller |
comment:2 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Fixed, r5268