From 9d4e91e717f17bb288f19a9eb05692af18648b42 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 20 Aug 2010 15:50:46 +0000 Subject: [PATCH] Creating a Type variable that refers to arguments[i]. Including parentheses when calling the constructor. r=elemoine (closes #2791) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10642 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/BaseTypes/Class.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/OpenLayers/BaseTypes/Class.js b/lib/OpenLayers/BaseTypes/Class.js index 0f21c37a72..f7f5af9f5b 100644 --- a/lib/OpenLayers/BaseTypes/Class.js +++ b/lib/OpenLayers/BaseTypes/Class.js @@ -35,30 +35,31 @@ OpenLayers.Class = function() { } }; var extended = {}; - var parent, initialize; + var parent, initialize, Type; for(var i=0, len=arguments.length; i 1) { - initialize = arguments[i].prototype.initialize; + initialize = Type.prototype.initialize; // replace the initialize method with an empty function, // because we do not want to create a real instance here - arguments[i].prototype.initialize = function() {}; + Type.prototype.initialize = function() {}; // the line below makes sure that the new class has a // superclass - extended = new arguments[i]; + extended = new Type(); // restore the original initialize method if(initialize === undefined) { - delete arguments[i].prototype.initialize; + delete Type.prototype.initialize; } else { - arguments[i].prototype.initialize = initialize; + Type.prototype.initialize = initialize; } } // get the prototype of the superclass - parent = arguments[i].prototype; + parent = Type.prototype; } else { // in this case we're extending with the prototype - parent = arguments[i]; + parent = Type; } OpenLayers.Util.extend(extended, parent); }