Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#5464 closed defect (fixed)

dojo.isDescendant returns -1 on errors

Reported by: tk Owned by: Adam Peller
Priority: high Milestone:
Component: Core Version: 1.0
Keywords: Cc: Adam Peller
Blocked By: Blocking:

Description

Per Adam, here's a ticket for this. dojo.isDescendant returns -1 if one of the args is invalid and causes an error. This breaks things like (dojo.isDescendant())?true:false since -1 will force this into the "true" branch.

this ticket refs #5425 (it is what caused that problem)

Change History (10)

comment:1 Changed 12 years ago by Adam Peller

Milestone: 1.1
Owner: changed from anonymous to alex

This seems to stem from [10981]. Alex, was the return -1 intentional? It seems like we're better off letting the exception get squelched and just return false? I'd say we could just do an object check instead of the try/catch, but there's probably some browser quirk reason for doing so.

comment:2 Changed 12 years ago by Karl Tiedt

Resolution: fixed
Status: newclosed

(In [11922]) fixes #5464 - updating dojo.isDescendant to return false on error !strict

comment:3 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: closedreopened

sorry, but why return false if it's going to happen in the next line anyway?

comment:4 Changed 12 years ago by tk

I spoke with Alex and that was the change that was discussed and ok'd.

comment:5 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: reopenedclosed

(In [11928]) so it seems right to revert this to [10980] unless there's a reason not to. Fixes #5464 !strict

comment:6 Changed 12 years ago by bill

The -1 return code from dojo.isDescendant() is from [10981], to fix http://trac.dojotoolkit.org/ticket/4307#comment:8 (which was a show-stopper issue). It doesn't seem to be an issue anymore though, presumably because we stopped using tables in the input widget templates. Keep your fingers crossed.

comment:7 Changed 12 years ago by Adam Peller

Milestone: 1.11.0.3
Resolution: fixed
Status: closedreopened
Version: 0.91.0

user reports that this prevented their tooltips from closing under certain situations. put fix in 1.0.x branch

comment:8 Changed 12 years ago by Adam Peller

Owner: changed from alex to Adam Peller
Status: reopenednew

comment:9 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [11992]) Fixes #5464 !strict

comment:10 Changed 12 years ago by (none)

Milestone: 1.0.3

Milestone 1.0.3 deleted

Note: See TracTickets for help on using tickets.