[OpenLayers-Commits] r10982 - in sandbox/tschaub/uncircular/lib/OpenLayers: . BaseTypes

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Sat Jan 1 15:31:33 EST 2011


Author: tschaub
Date: 2011-01-01 12:31:33 -0800 (Sat, 01 Jan 2011)
New Revision: 10982

Modified:
   sandbox/tschaub/uncircular/lib/OpenLayers/BaseTypes/Class.js
   sandbox/tschaub/uncircular/lib/OpenLayers/Util.js
Log:
Removing hard circular dependency.

Modified: sandbox/tschaub/uncircular/lib/OpenLayers/BaseTypes/Class.js
===================================================================
--- sandbox/tschaub/uncircular/lib/OpenLayers/BaseTypes/Class.js	2011-01-01 20:30:19 UTC (rev 10981)
+++ sandbox/tschaub/uncircular/lib/OpenLayers/BaseTypes/Class.js	2011-01-01 20:31:33 UTC (rev 10982)
@@ -106,3 +106,50 @@
        OpenLayers.Util.extend(C.prototype, o);
    }
 };
+
+/**
+ * APIFunction: extend
+ * Copy all properties of a source object to a destination object.  Modifies
+ *     the passed in destination object.  Any properties on the source object
+ *     that are set to undefined will not be (re)set on the destination object.
+ *
+ * Parameters:
+ * destination - {Object} The object that will be modified
+ * source - {Object} The object with properties to be set on the destination
+ *
+ * Returns:
+ * {Object} The destination object.
+ */
+OpenLayers.Util = OpenLayers.Util || {};
+OpenLayers.Util.extend = function(destination, source) {
+    destination = destination || {};
+    if (source) {
+        for (var property in source) {
+            var value = source[property];
+            if (value !== undefined) {
+                destination[property] = value;
+            }
+        }
+
+        /**
+         * IE doesn't include the toString property when iterating over an object's
+         * properties with the for(property in object) syntax.  Explicitly check if
+         * the source has its own toString property.
+         */
+
+        /*
+         * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
+         * prototype object" when calling hawOwnProperty if the source object
+         * is an instance of window.Event.
+         */
+
+        var sourceIsEvt = typeof window.Event == "function"
+                          && source instanceof window.Event;
+
+        if (!sourceIsEvt
+           && source.hasOwnProperty && source.hasOwnProperty("toString")) {
+            destination.toString = source.toString;
+        }
+    }
+    return destination;
+};

Modified: sandbox/tschaub/uncircular/lib/OpenLayers/Util.js
===================================================================
--- sandbox/tschaub/uncircular/lib/OpenLayers/Util.js	2011-01-01 20:30:19 UTC (rev 10981)
+++ sandbox/tschaub/uncircular/lib/OpenLayers/Util.js	2011-01-01 20:31:33 UTC (rev 10982)
@@ -4,6 +4,10 @@
  * full text of the license. */
 
 /**
+ * @requires OpenLayers/BaseTypes.js
+ * @requires OpenLayers/BaseTypes/Element.js
+ * @requires OpenLayers/BaseTypes/LonLat.js
+ * @requires OpenLayers/BaseTypes/Size.js
  * @requires OpenLayers/Console.js
  * @requires OpenLayers/Lang.js
  */
@@ -11,7 +15,7 @@
 /**
  * Namespace: Util
  */
-OpenLayers.Util = {};
+OpenLayers.Util = OpenLayers.Util || {};
 
 /** 
  * Function: getElement
@@ -54,53 +58,6 @@
     window.$ = OpenLayers.Util.getElement;
 }
 
-/**
- * APIFunction: extend
- * Copy all properties of a source object to a destination object.  Modifies
- *     the passed in destination object.  Any properties on the source object
- *     that are set to undefined will not be (re)set on the destination object.
- *
- * Parameters:
- * destination - {Object} The object that will be modified
- * source - {Object} The object with properties to be set on the destination
- *
- * Returns:
- * {Object} The destination object.
- */
-OpenLayers.Util.extend = function(destination, source) {
-    destination = destination || {};
-    if(source) {
-        for(var property in source) {
-            var value = source[property];
-            if(value !== undefined) {
-                destination[property] = value;
-            }
-        }
-
-        /**
-         * IE doesn't include the toString property when iterating over an object's
-         * properties with the for(property in object) syntax.  Explicitly check if
-         * the source has its own toString property.
-         */
-
-        /*
-         * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
-         * prototype object" when calling hawOwnProperty if the source object
-         * is an instance of window.Event.
-         */
-
-        var sourceIsEvt = typeof window.Event == "function"
-                          && source instanceof window.Event;
-
-        if(!sourceIsEvt
-           && source.hasOwnProperty && source.hasOwnProperty('toString')) {
-            destination.toString = source.toString;
-        }
-    }
-    return destination;
-};
-
-
 /** 
  * Function: removeItem
  * Remove an object from an array. Iterates through the array



More information about the Commits mailing list