그대는 지금 실수하고 있다. 쟈스의 방식은 따로있다... 이것은 하나의 슈가..


var Klass = function(Parent, props) {

  var Child, F, i;


  Child = function() {

    if (Child.uber && Child.uber.hasOwnProperty("__construct")) {

      Child.uber.__construct.apply(this, arguments);

    }

    if (Child.prototype.hasOwnProperty("__construct")) {

      Child.prototype.__construct.apply(this, arguments);

    }

  };


  Parent = Parent || Object;

  F = function () {};

  F.prototype = Parent.prototype;

  Child.prototype = new F ();

  Child.uber = Parent.prototype;

  Child.prototype.constructor = Child;


  for (i in props) {

    if (props.hasOwnProperty(i)) {

      Child.prototype[i] = propsp[i];

    }

  }


  return Child;

}


var Man = Klass(null, {

  __construct: function (what) {

    console.log("Man's constructor");

    this.name = what;

  },

  getName: function() {

    return this.name;

  }

});


var SuperMan = Klass(Man, {

  __construct: function (what) {

    console.log("SuperMan's constructor");

    this.name = what;

  },

  getName: function() {

    var name = SuperMan.uber.getName.call(this);

    return "I am " + name;

  }

});