Changeset 7943
- Timestamp:
- 09/03/08 22:19:41 (3 months ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Util.js (modified) (1 diff)
- trunk/openlayers/tests/Util.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Util.js
r7888 r7943 564 564 * the source has its own toString property. 565 565 */ 566 if(!fromIsEvt && from .hasOwnProperty566 if(!fromIsEvt && from && from.hasOwnProperty 567 567 && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) { 568 568 to.toString = from.toString; trunk/openlayers/tests/Util.html
r7538 r7943 170 170 function test_Util_applyDefaults(t) { 171 171 172 t.plan(1 1);172 t.plan(12); 173 173 174 174 var to = { … … 205 205 var ret = OpenLayers.Util.applyDefaults(to, from); 206 206 t.eq(ret.rand, from.rand, "works with undefined to"); 207 208 //regression test for #1716 -- allow undefined from 209 try { 210 OpenLayers.Util.applyDefaults({}, undefined); 211 t.ok(true, "no exception thrown when from is undefined"); 212 } catch(err) { 213 t.fail("exception thrown when from is undefined:" + err); 214 } 215 207 216 } 208 217
