This project is archived and is in readonly mode.

#673 ✓resolved
efyx

"Class extended then implemented" don't work in 1.2.2

Reported by efyx | May 20th, 2009 @ 12:43 PM | in 2.0 (closed)

If I extend a class and then implement it in another Class i have the following error : "this.caller._owner.parent is undefined" (the class can't access to his parent)

There is a sample in the attached file. I also added a "quick & dirty fix" to temporary solve this issue.

Comments and changes to this ticket

  • Chris the Developer

    Chris the Developer May 20th, 2009 @ 01:04 PM

    I'm not sure that this.parent is supposed to reference the previously overridden method (method of the parent). The only place I've seen it used is when overriding the initialize method in an extending class.

    MyExtendable = new Class({
                    initialize: function(name) {
                        console.log(name);
                    }   
                });
                
                MyExtension = new Class({
                    Extends: MyExtendable,
                    
                    initialize: function(name, age) {
                        this.parent(name);
                        
                        console.log(age);
                    }
                });
    

    That works without issue. I'm almost certain that this.parent is a reference to the parent classes initialize method, and nothing more.

  • Valerio

    Valerio May 20th, 2009 @ 04:47 PM

    • State changed from “new” to “open”

    "I'm almost certain that this.parent is a reference to the parent classes initialize method, and nothing more."

    No, this is indeed a bug :)

  • Chris the Developer
  • Valerio

    Valerio February 16th, 2010 @ 02:41 PM

    • State changed from “open” to “resolved”
  • Valerio

    Valerio February 16th, 2010 @ 02:41 PM

    This has been fixed in 1.2.4

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Attachments

Pages