Do "John" and "him" point to the same thing in the following sentence?

The boy continued to whip the pony , and eventually the pony threw him over. John laughed out quite loud. "Good for *him* ," he said.
no