Adding a bit of flexibility to extend and applyDefaults. First argument can now be undefined. r=pspencer,elemoine (closes #1564)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7311 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-06-05 20:37:40 +00:00
parent 0ecb973e1c
commit 74f4338fe0
8 changed files with 34 additions and 37 deletions

View File

@@ -49,7 +49,8 @@ if ($ == null) {
* {Object} The destination object.
*/
OpenLayers.Util.extend = function(destination, source) {
if(destination && source) {
destination = destination || {};
if(source) {
for(var property in source) {
var value = source[property];
if(value !== undefined) {
@@ -522,7 +523,7 @@ OpenLayers.Util.upperCaseObject = function (object) {
* in place and returned by this function.
*/
OpenLayers.Util.applyDefaults = function (to, from) {
to = to || {};
/*
* FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
* prototype object" when calling hawOwnProperty if the source object is an