Opened 14 years ago
Closed 13 years ago
#4452 closed bug (fixed)
Error when calling jQuery.trim
Reported by: | buchi | Owned by: | flesler |
---|---|---|---|
Priority: | major | Milestone: | 1.4.3 |
Component: | core | Version: | 1.4.2 |
Keywords: | trim, integer | Cc: | buchi |
Blocked by: | Blocking: |
Description
Calling: jQuery.trim(1)
results in:
"").replace is not a function |
Source: jquery-1.3.2.js, Line: 1067
IMHO this should return "1"
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Maybe you know it better than I and you're right when passing other objects to jQuery.trim, but in case of an integer it could return the string version of this integer. So the trim-regex won't be needed. I wanted to discuss this behaviour because I got the mentioned error and at first I had no idea what was wrong. Other functions also handle integers like strings, e.g. alert("123") does the same as alert(123)
comment:3 Changed 14 years ago by
Cc: | buchi added |
---|---|
Owner: | set to flesler |
comment:4 Changed 13 years ago by
Milestone: | 1.4 → 1.4.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | 1.3.2 → 1.4.2 |
Note: See
TracTickets for help on using
tickets.
What should it return on an object, function, regexp, or date object? In some cases it's just best to give the user an error asap.