Recursive function which merge objectB into objectA. Returns merged objectA.