This project is archived and is in readonly mode.

#506 ✓resolved

Class - IE Inheritance Bug

Reported by atwork8 | December 1st, 2008 @ 10:54 PM | in 1.3.0 rc2 (closed)


I created a Parent class, and then a Child class that Extends Parent. If I give both classes a toString() method, the Child class always calls the Parent toString() method and not its own version. It works fine in firefox.

I'm guessing it has something to do with the "DontEnum bug" workaround, as it works fine for all functions whose name doesn't mirror those with the DontEnum attribute.

I'm not sure what mooTools intends the result to be, the firefox or IE result? Probably the firefox result?

Thanks :o)

    var Animal = new Class({
        toString: function() {
            alert('Animal toString');
        noDontEnum: function() {
            alert('Animal noDontEnum');
    var Cat = new Class({
        Extends: Animal,
        toString: function() {
            alert('Cat toString');
        noDontEnum: function() {
            alert('Cat noDontEnum');
    var c = new Cat();
    c.toString(); // => 'Animal toString' in IE
    c.noDontEnum(); // => 'Cat noDontEnum'

Comments and changes to this ticket

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