Ticket #1480: patch-1480-r6762-A0.diff
| File patch-1480-r6762-A0.diff, 2.1 kB (added by elemoine, 9 months ago) |
|---|
-
lib/OpenLayers/Util.js
old new 56 56 destination[property] = value; 57 57 } 58 58 } 59 59 60 /** 60 61 * IE doesn't include the toString property when iterating over an object's 61 62 * properties with the for(property in object) syntax. Explicitly check if 62 63 * the source has its own toString property. 63 64 */ 64 if(source.hasOwnProperty && source.hasOwnProperty('toString')) { 65 66 /* 67 * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative 68 * prototype object" when calling hawOwnProperty if the source object 69 * is an instance of window.Event. 70 */ 71 72 var sourceIsEvt = typeof window.Event == "function" 73 && source instanceof window.Event; 74 75 if(!sourceIsEvt 76 && source.hasOwnProperty && source.hasOwnProperty('toString')) { 65 77 destination.toString = source.toString; 66 78 } 67 79 } … … 510 522 * in place and returned by this function. 511 523 */ 512 524 OpenLayers.Util.applyDefaults = function (to, from) { 525 526 /* 527 * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative 528 * prototype object" when calling hawOwnProperty if the source object is an 529 * instance of window.Event. 530 */ 531 var fromIsEvt = typeof window.Event == "function" 532 && from instanceof window.Event; 533 513 534 for (var key in from) { 514 535 if (to[key] === undefined || 515 ( from.hasOwnProperty536 (!fromIsEvt && from.hasOwnProperty 516 537 && from.hasOwnProperty(key) && !to.hasOwnProperty(key))) { 517 538 to[key] = from[key]; 518 539 } … … 522 543 * properties with the for(property in object) syntax. Explicitly check if 523 544 * the source has its own toString property. 524 545 */ 525 if( from.hasOwnProperty546 if(!fromIsEvt && from.hasOwnProperty 526 547 && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) { 527 548 to.toString = from.toString; 528 549 }
