In the example of
John baked Mary a cake for her birthday.
John cried a river of tears over Mary.
Which is the object in the sentences? Are both the object 'Mary'? If so, why?
Mary might be the object of John's affection and the cause of his tears, but Mary is not the grammatical direct object of the verb baked, rather a cake is; and a river of tears is the direct object of cried.
In the cake example, Mary occupies the indirect object position.
In the tears example, Mary is the object of the preposition over.