context: PageBot = function(pageWindow, browserBot) {    this.currentWindow = pageWindow;    this.browserBot = browserBot;    this.currentDocument = pageWindow.document;    this.location = pageWindow.location.pathname;    this.title = function() {return this.currentDocument.title};    modifyWindowToRecordAlerts(pageWindow, browserBot);            //SPIKE factor this better via TDD        function clearPageCache() {       browserbot.currentPage = null;    }        if (window.addEventListener) {        this.currentWindow.addEventListener("unload",clearPageCache, true);    }         else if (window.attachEvent) {        this.currentWindow.attachEvent("onunload",clearPageCache);    }     // End SPIKE        function modifyWindowToRecordAlerts(window, browserBot) {              window.alert = function(alert){browserBot.recordAlert(alert);};    }}
meta: 3428	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3428/d234886e8fa68dac43c3506a745065790965587c/selenium-browserbot.js/buggy/javascript/selenium-browserbot.js