Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7028 closed bug (duplicate)

Data and event handling breaks with derivation from Array type

Reported by: mathbr Owned by:
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


If one tries to derive from the base type "Array", neither data nor event handling work anymore. See the following example:

function Model() {
    this.push = function(item) {
        Model.prototype.push.call(this, item);
        $(this).trigger('added', [item]);
Model.prototype = new Array;

var m = new Model();
$(m).data('test', 'TEST');

    'added': function(event, item) {
        alert('Item added: ' + item);


The value of the "test" data is suddenly undefined, the event "myEvent" is never fired.

Change History (1)

comment:1 Changed 12 years ago by dmethvin

Priority: undecided
Resolution: duplicate
Status: newclosed

Dup of #6355.

Note: See TracTickets for help on using tickets.