Opened 13 years ago

Closed 13 years ago

#2644 closed defect (wontfix)

Problem with _inherited

Reported by: niels.bosma@… Owned by: sjmiles
Priority: blocker Milestone:
Component: Core Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

For the following code:

dojo.require("dojo.lang.declare");

dojo.declare("my.classes.G1", null, {

activate : function() {

dojo.debug("G1:activate");

}

});

dojo.declare("my.classes.G2", my.classes.G1, {

activate : function() {

dojo.debug("G2:activate");

this._inherited("activate",arguments);

}

});

dojo.declare("my.classes.G3", my.classes.G2, {

activate : function() {

dojo.debug("G3:activate");

this._inherited("activate",arguments);

}

});

dojo.declare("my.classes.G4", my.classes.G3, {

/*

activate : function()

{

dojo.debug("G4:activate");

this._inherited("activate",arguments);

}

*/

});

var obj = new my.classes.G4(); obj.activate();

I get the following debug printouts.

DEBUG: G3:activate DEBUG: G3:activate DEBUG: G2:activate DEBUG: G1:activate

G3 is evaluated twice.

Change History (2)

comment:1 Changed 13 years ago by sjmiles

Owner: changed from anonymous to sjmiles

comment:2 Changed 13 years ago by sjmiles

Resolution: wontfix
Status: newclosed

"inherited" is known to be brittle, that's why it's now private (note the underscore).

The 0.9 version is more robust.

Note: See TracTickets for help on using tickets.