Skip to content

Commit

Permalink
enhance merge method and fix ec option.backgroundColor merge bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Jan 14, 2016
1 parent ad46a25 commit 08855cd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,15 @@ define(function(require) {
}

/**
* @param {Object=} target
* @param {Object=} source
* @param {*} target
* @param {*} source
* @param {boolean} [overwrite=false]
*/
function merge(target, source, overwrite) {
if (!target) { // Might be null/undefined
return;
}
if (!source) { // Might be null/undefined
return target;
// We should escapse that source is string
// and enter for ... in ...
if (!isObject(source) || !isObject(target)) {
return overwrite ? clone(source) : target;
}

for (var key in source) {
Expand Down

0 comments on commit 08855cd

Please sign in to comment.