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); }