Whenever trying to merge two string values maximum callstack error is thrown.
Fix it by simply returning the second occurrence rather than the first if the type of the values differs from object.
For a simple repro:
function merge_obj(obj, secondObj) {
if (!obj)
return secondObj;
for(var i in secondObj)
obj[i] = merge_obj(obj[i], secondObj[i]);
return obj;
}
merge_obj("test", "other")
Whenever trying to merge two string values maximum callstack error is thrown. Fix it by simply returning the second occurrence rather than the first if the type of the values differs from object.
For a simple repro:
Ping @alunny for review.