Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#348 closed defect (fixed)

dojo.lang.find is not consistently polymorphic

Reported by: [email protected] Owned by: skinner
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: Cc: [email protected]
Blocked By: Blocking:


dojo.lang.find() tries to support two call signatures:

  1. dojo.lang.find(array, value, identity)
  2. dojo.lang.find(value, array, identity)

I think #1 (array, value) always works. I think #2 (value, array) mostly works, but maybe not consistently.

For example, these three assert statements should all pass, but the third one fails:

jum.assertTrue("passes", dojo.lang.find(56, [45, 56, 85]) == 1); jum.assertTrue("passes", dojo.lang.find([Number, String, Date], String) == 1); jum.assertTrue("fails", dojo.lang.find(String, [Number, String, Date]) == 1);

Change History (3)

comment:1 Changed 16 years ago by alex

Owner: changed from anonymous to skinner

comment:2 Changed 16 years ago by alex

Resolution: fixed
Status: newclosed

comment:3 Changed 15 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.