Commit 323a5c27 323a5c27b8e086f9a842257872472c1a3fb1b0a9 by Nicolas Perriault

updated utils.mergeObjects() wording & docs

1 parent 4e0b7878
1 Subproject commit 8f3d23e52d3552564310990b79d4a6b4a3e1d06f 1 Subproject commit c49485298b9ed585d7fec76305d96f2689ab8bd4
......
...@@ -305,23 +305,23 @@ exports.isWebPage = isWebPage; ...@@ -305,23 +305,23 @@ exports.isWebPage = isWebPage;
305 /** 305 /**
306 * Object recursive merging utility. 306 * Object recursive merging utility.
307 * 307 *
308 * @param Object obj1 the destination object 308 * @param Object origin the origin object
309 * @param Object obj2 the source object 309 * @param Object add the object to merge data into origin
310 * @return Object 310 * @return Object
311 */ 311 */
312 function mergeObjects(obj1, obj2) { 312 function mergeObjects(origin, add) {
313 for (var p in obj2) { 313 for (var p in add) {
314 try { 314 try {
315 if (obj2[p].constructor === Object) { 315 if (add[p].constructor === Object) {
316 obj1[p] = mergeObjects(obj1[p], obj2[p]); 316 origin[p] = mergeObjects(origin[p], add[p]);
317 } else { 317 } else {
318 obj1[p] = obj2[p]; 318 origin[p] = add[p];
319 } 319 }
320 } catch(e) { 320 } catch(e) {
321 obj1[p] = obj2[p]; 321 origin[p] = add[p];
322 } 322 }
323 } 323 }
324 return obj1; 324 return origin;
325 } 325 }
326 exports.mergeObjects = mergeObjects; 326 exports.mergeObjects = mergeObjects;
327 327
......