Opened 12 years ago

Closed 11 years ago

#5961 closed defect (fixed)

[patch][ccla]dojo.indexOf on a hash loops forever

Reported by: Adam Peller Owned by: alex
Priority: high Milestone: 1.1
Component: General Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description

dojo.indexOf({a:1},"a");

see #5956

Attachments (1)

5961.patch (6.9 KB) - added by Adam Peller 11 years ago.
fix passing in array (array.length is undefined) as well as bounds checking to prevent infinite loop

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by Adam Peller

should probably return -1, as Mozilla does.

>>> Array.indexOf({a:1},'a')
-1

comment:2 Changed 12 years ago by alex

Milestone: 1.1
Owner: changed from anonymous to alex
Status: newassigned

comment:3 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

(In [12683]) Avoid infinite loop in indexOf. Fixes #5961

comment:4 Changed 11 years ago by Adam Peller

Resolution: fixed
Status: closedreopened

re-b0rken by [12798]

comment:5 Changed 11 years ago by Adam Peller

Summary: dojo.indexOf on a hash loops forever[patch][ccla]dojo.indexOf on a hash loops forever

Changed 11 years ago by Adam Peller

Attachment: 5961.patch added

fix passing in array (array.length is undefined) as well as bounds checking to prevent infinite loop

comment:6 Changed 11 years ago by alex

Resolution: fixed
Status: reopenedclosed

(In [13155]) merging adam peller's patch for infinite loop catching. Fixes #5961. !strict

Note: See TracTickets for help on using tickets.