Sample code to illustrate my Class problems :



if(!OC) var OC = {};
if(!OC.Controls) OC.Controls = {};

OC.Controls.ErrorSample = {
    errorObjects : [],

    register: function(errorObject)
    {
        this.errorObjects.push(errorObject);
    },

    unregister: function()
    {
        this.errorObjects.pop();
    }
};

OC.Controls.ErrorSample = function(name)
{
    this.__init__(name);
};

OC.Controls.ErrorSample.prototype = {
    __init__ : function(name)
    {
        this.controlName = name;
        //This line generate error;
        OC.Controls.ErrorSample.register(this);

        //If I adjust above code with
        // OC.Controls.ErrorSample1.register(this);
        // also update above class code to use ErrorSample1 as name
    }
}



please copy test above code and you will see error at
"OC.Controls.ErrorSample.register(this);" line.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to