>>112235115There are apparently several hours of unused footage of Robin Williams in the recording studio at Disney. They had an outline of what was supposed to happen in the scene, but he would just go off on a tangent and they let him go because he was one of his greatest strengths was his improv comedy. A lot of the dialogue that ended up in the movie was just improv and random impressions that he felt like doing.
Because of the way that he had been treated, one of the things that Robin specified in his will was that Disney was not authorized to use his voice or his likeness in their films after his death. If hadn't have done that, Disney probably would have cobbled together another Aladdin movie by now.