demos/Collage/fabric.js
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], parent);
    }
    if (!klass.prototype.initialize) {
      klass.prototype.initialize = emptyFunction;
    }
    klass.prototype.constructor = klass;
    return klass;
  }
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], parent);
    }
    if (!klass.prototype.initialize) {
      klass.prototype.initialize = emptyFunction;
    }
    klass.prototype.constructor = klass;
    return klass;
  }
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 ] , parent ) ; } if ( ! klass . prototype . initialize ) { klass . prototype . initialize = emptyFunction ; } klass . prototype . constructor = klass ; return klass ; }
Helper for creation of "classes"
@method createClass
@memberOf fabric.util
Helper for creation of classes