Opened 14 years ago
Closed 14 years ago
#2644 closed defect (wontfix)
Problem with _inherited
Reported by: | 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 14 years ago by
Owner: | changed from anonymous to sjmiles |
---|
comment:2 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
"inherited" is known to be brittle, that's why it's now private (note the underscore).
The 0.9 version is more robust.