No need to recreate `subclass` function every time inheritance is being set up in `Class.create`

This commit is contained in:
Juriy Zaytsev 2009-05-25 21:55:06 -04:00 committed by Juriy Zaytsev
parent 78f6fad570
commit f50dc3639d
1 changed files with 1 additions and 1 deletions

View File

@ -35,6 +35,7 @@ var Class = (function() {
*
* To extend a class after it has been defined, use [[Class#addMethods]].
**/
function subclass() {};
function create() {
var parent = null, properties = $A(arguments);
if (Object.isFunction(properties[0]))
@ -49,7 +50,6 @@ var Class = (function() {
klass.subclasses = [];
if (parent) {
var subclass = function() {};
subclass.prototype = parent.prototype;
klass.prototype = new subclass;
parent.subclasses.push(klass);