From f50dc3639d60f4b16e12d638b01309dde48aa955 Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Mon, 25 May 2009 21:55:06 -0400 Subject: [PATCH] No need to recreate `subclass` function every time inheritance is being set up in `Class.create` --- src/lang/class.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/class.js b/src/lang/class.js index c666e37..5c7fa27 100644 --- a/src/lang/class.js +++ b/src/lang/class.js @@ -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);