(function() {
  
  var slice = Array.prototype.slice, emptyFunction = function() { };
  
  var IS_DONTENUM_BUGGY = (function(){
    for (var p in { toString: 1 }) {
      if (p === 'toString') return false;
    }
    return true;
  })();
  
  var addMethods;
  if (IS_DONTENUM_BUGGY) {
    /** @ignore */
    addMethods = function(klass, source) {
      if (source.toString !== Object.prototype.toString) {
        klass.prototype.toString = source.toString;
      }
      if (source.valueOf !== Object.prototype.valueOf) {
        klass.prototype.valueOf = source.valueOf;
      }
      for (var property in source) {
        klass.prototype[property] = source[property];
      }
    };
  }
  else {
    /** @ignore */
    addMethods = function(klass, source) {
      for (var property in source) {
        klass.prototype[property] = source[property];
      }
    };
  }

  function subclass() { };
  
  /**
   * Helper for creation of "classes"
   * @method createClass
   * @memberOf fabric.util
   */
  function createClass() {
    var parent = null, 
        properties = slice.call(arguments, 0);
    
    if (typeof properties[0] === 'function') {
      parent = properties.shift();
    }
    function klass() {
      this.initialize.apply(this, arguments);
    }
    
    klass.superclass = parent;
    klass.subclasses = [ ];

    if (parent) {
      subclass.prototype = parent.prototype;
      klass.prototype = new subclass;
      parent.subclasses.push(klass);
    }
    for (var i = 0, length = properties.length; i < length; i++) {
      addMethods(klass, properties[i]);
    }
    if (!klass.prototype.initialize) {
      klass.prototype.initialize = emptyFunction;
    }
    klass.prototype.constructor = klass;
    return klass;
  }
  
  fabric.util.createClass = createClass;
})();
@@ -7,18 +7,16 @@
 ion() %7B%0A
-  
 %0A  var s
@@ -77,18 +77,16 @@
 () %7B %7D;%0A
-  
 %0A  var I
@@ -231,58 +231,9 @@
 ();%0A
-  
 %0A
-  var addMethods;%0A  if (IS_DONTENUM_BUGGY) %7B%0A  
   /*
@@ -239,33 +239,35 @@
 ** @ignore */%0A  
- 
+var
  addMethods = fu
@@ -290,71 +290,148 @@
 urce
-) %7B%0A      if (source.toString !== Object.prototype.toString
+, parent) %7B%0A    for (var property in source) %7B%0A%0A      if (property in klass.prototype && typeof klass.prototype%5Bproperty%5D == 'function'
 ) %7B%0A
+%0A
     
@@ -453,43 +453,138 @@
 type
-.toString = source.toString
+%5Bproperty%5D = (function(property) %7B%0A          return function() %7B%0A%0A            var superclass = this.constructor.superclass
 ;%0A      
 %7D%0A  
@@ -583,159 +583,323 @@
     
-%7D%0A
       
-if (source.valueOf !== Object.prototype.valueOf) %7B%0A        klass.prototype.valueOf = source.valueOf;%0A      %7D%0A      for (var property in source)
+this.constructor.superclass = parent;%0A            var returnValue = source%5Bproperty%5D.apply(this, arguments);%0A            this.constructor.superclass = superclass;%0A%0A            if (property !== 'initialize') %7B%0A              return returnValue;%0A            %7D%0A          %7D%0A        %7D)(property);%0A      %7D%0A      else
  %7B%0A 
@@ -963,127 +963,226 @@
   %7D%0A
+%0A
     
-%7D;%0A  %7D%0A  else %7B%0A    /** @ignore */%0A    addMethods = function(klass, source) %7B%0A      for (var property in source
+  if (IS_DONTENUM_BUGGY) %7B%0A        if (source.toString !== Object.prototype.toString) %7B%0A          klass.prototype.toString = source.toString;%0A        %7D%0A        if (source.valueOf !== Object.prototype.valueOf
 ) %7B%0A
+  
     
@@ -1204,45 +1204,41 @@
 type
-%5Bproperty%5D = source%5Bproperty%5D
+.valueOf = source.valueOf
 ;%0A      
 %7D%0A  
@@ -1237,20 +1237,30 @@
     
+  
 %7D%0A    
+ 
-%7D;%0A  %7D
+ %7D%0A    %7D%0A  %7D;
 %0A%0A  
@@ -1284,18 +1284,16 @@
 () %7B %7D;%0A
-  
 %0A  /**%0A 
@@ -1436,17 +1436,16 @@
  = null,
- 
 %0A       
@@ -1484,20 +1484,16 @@
 ts, 0);%0A
-    
 %0A    if 
@@ -1648,20 +1648,16 @@
 ;%0A    %7D%0A
-    
 %0A    kla
@@ -1957,16 +1957,24 @@
 rties%5Bi%5D
+, parent
 );%0A    %7D
@@ -2132,18 +2132,16 @@
 ss;%0A  %7D%0A
-  
 %0A  fabri

Fix subclassing mechanism to work correctly with 2+ level deep inheritance. Closes #134. Closes #141.