alexgorbatchev/node-browser-builtins — pull request #20 by substack (2013-09-13 19:23:03+00:00)
Title: check for the presence of window and {set,clear}{Timeout,Interval}

I was upgrading browserify to use the latest browser-builtins version and the tests were failing because window and set{Timeout,Interval} weren't defined in the empty vm context that browserify was passing to the bundle. The timers module was being loaded even though none of its functionality was being used. This patch tests for the presence of window, setTimeout, setInterval, clearTimeout, and clearInterval before assigning them onto the exports which is very handy when you need to run a bundle in a vm.runInNewContext with node for debugging and testing.