Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1171 closed defect (fixed)

dojo.string.substituteParams can't substitute 0 or "0"

Reported by: tim@… 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 13 years ago by Adam Peller

Milestone: 0.4
Owner: changed from psowden to Adam Peller

comment:2 Changed 13 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

Fixed, r5268

comment:3 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.