var window = {}
var document = {}
... of course, they won't do a lot of good unless you populate them with the properties that the script is trying to access.
You can't just populate them with the standard browser APIs - most of them don't make sense outside the context of the browser.