Opened 12 years ago

Closed 12 years ago

#6768 closed bug (notabug)

Dialog box button iteration bug

Reported by: SlappyZA Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.core Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:

Description

I have stumbled on a edge case where by if the Array prototype has been extended, then when creating buttons using the button array for the modal dialog box, the function names of the extended prototype appear as buttons too. I suspect this is due to iterating over the button array using associative array loops instead of counter loops.

Steps to reproduce:

1: Create a function that extends the array prototype:

Array.prototype.someFunction = function () {}

2: Create a dialog:

$('#element').dialog({
            modal: true,
            buttons: [
                { text: 'Select', click: function(){} },
                { text: 'Cancel', click: function() {} }
            ]
        });

Expected Result: There will be three buttons on the dialog: Select, Cancel and someFunction

Change History (1)

comment:1 Changed 12 years ago by Scott González

Resolution: invalid
Status: newclosed

We don't support modifying native prototypes.

Note: See TracTickets for help on using tickets.