https://bugzilla.wikimedia.org/show_bug.cgi?id=62405

            Bug ID: 62405
           Summary: Documentation for inheritClass has broken example
           Product: OOjs
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: gti...@wikimedia.org
                CC: jforres...@wikimedia.org, krinklem...@gmail.com,
                    roan.katt...@gmail.com, tpars...@wikimedia.org
       Web browser: ---
   Mobile Platform: ---

The docblock for inheritClass uses this code snippet as an example:

    function Thing() {}
    Thing.prototype.exists = function () {};

    function Person() {
        this.constructor.super.apply( this, arguments );
    }
    oo.inheritClass( Person, Thing );
    Person.static.defaultEyeCount = 2;
    Person.prototype.walk = function () {};

    function Jumper() {
         this.constructor.super.apply( this, arguments );
    }
    OO.inheritClass( Jumper, Person );
    Jumper.prototype.jump = function () {};

    Jumper.static.defaultEyeCount === 2;
    var x = new Jumper();

When actually executed, this will result in an infinite recursion since
this.constructor.super does not change as the call progresses up the
inheritance chain.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to