pass window document and undefined