Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#15012 closed defect (fixed)

getType in MVC (inconsistent behavior in MSIE and Others)

Reported by: mm Owned by: Ed Chatelain
Priority: undecided Milestone: 1.8
Component: DojoX MVC Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


getType: function(/*Anything*/ v){

summary: Returns the type of the given value. v: Anything The value.

return lang.isArray(v) ? "array" : {} == "[object Object]" ? "object" : "value";


test this line for null in MSIE and Others {}

I believe it shall return "value" in all browsers. in MSIE it returns "object".

Please check also other occurrences of this pattern {} in mvc/*.

And let us know.

Consistent behavior is important for input widgets that make difference between null and "" values.

Change History (9)

comment:1 Changed 9 years ago by ben hockey

Object(v) === v might be useful in this case - it returns false for all primitive values (null, undefined, boolean, string, number)

comment:2 Changed 9 years ago by mm

Please any hope for fix ?

comment:3 Changed 9 years ago by ben hockey

it was just applied - see #14681. i'll leave this for edchat to close this ticket when he's ready.

comment:4 Changed 9 years ago by Ed Chatelain

A fix is in, but I am going to be tweaking it a little bit.

comment:5 Changed 9 years ago by mm

re: neon, to your first post: I'm affraid that simple if v== null would be more appropriate, if null and undefined are supplied to Object(v), it creates useless object just to find that null and undefined "is primitive" (which is incorrect statement again ;-))) BTW ;-)

comment:6 Changed 9 years ago by ben hockey

mm - see for more of the discussion.

comment:7 Changed 9 years ago by Ed Chatelain

Resolution: fixed
Status: newclosed

This is now fixed.

comment:8 Changed 9 years ago by bill

Milestone: tbd1.8

comment:9 Changed 9 years ago by Ed Chatelain

The fix went in with changeset [28183]:

Note: See TracTickets for help on using tickets.