my-class
my-class copied to clipboard
Simplify parent method call
Hi Actually this is the simple and best performance class definition in javascript. I have analised it and compared with other javascript libs. Now in my opitionion the best would be to simplyfy parent method access from child. For example: if now it is Child.Super.prototype.setAddress.call(this); make something like this: this.parent.setAddress.call(this, 'France', city, street);
I will try to do that.
Thanks Alban!
the _"this.parent.setAddress.call(_this, 'France', city, street);" syntax doesn't work if there are more than 2 inheritance levels (infinite loop). The access to the parent constructor must be static (no "this").
See more in the section "Extend a class" of http://jiem.github.io/my-class/
Cheers
On Thu Jan 22 2015 at 8:06:33 AM Alban [email protected] wrote:
Hi Actually this is the simple and best performance class definition in javascript. I have analised it and compared with other javascript libs. Now in my opitionion the best would be to simplyfy parent method access from child. For example: if now it is Child.Super.prototype.setAddress.call(this); make something like this: this.parent.setAddress.call(this, 'France', city, street);
I will try to do that.
Reply to this email directly or view it on GitHub https://github.com/jiem/my-class/issues/8.
Yes actually I know that, I had some days headache about that, trying different test and approaches, at first I thought I have done it but when I added the third level it blow up in infinite loop.
Even it is not handy for the moment yours is the best method for performance. John Resig one is nice but very slow. I have notice that big libraries like Ckeditor uses some even more slow definition of class, but actually very rare in their code. Most of their code is based on pure prototype.
On Thu, Jan 22, 2015 at 5:39 PM, Jie Meng-Gérard [email protected] wrote:
Thanks Alban!
the _"this.parent.setAddress.call(_this, 'France', city, street);" syntax doesn't work if there are more than 2 inheritance levels (infinite loop). The access to the parent constructor must be static (no "this").
See more in the section "Extend a class" of http://jiem.github.io/my-class/
Cheers
On Thu Jan 22 2015 at 8:06:33 AM Alban [email protected] wrote:
Hi Actually this is the simple and best performance class definition in javascript. I have analised it and compared with other javascript libs. Now in my opitionion the best would be to simplyfy parent method access from child. For example: if now it is Child.Super.prototype.setAddress.call(this); make something like this: this.parent.setAddress.call(this, 'France', city, street);
I will try to do that.
Reply to this email directly or view it on GitHub https://github.com/jiem/my-class/issues/8.
— Reply to this email directly or view it on GitHub https://github.com/jiem/my-class/issues/8#issuecomment-71050976.
www.albanx.com www.albanx.com/ajaxuploader