kriskowal/q — pull request #572 by orcaman (2014-08-19 16:12:44+00:00)
Title: check module is defined before adding exports (chrome extensions bug?)

on chrome extensions that I have tested, the test typeof exports === "object" is not enough (it can pass and then reach the module.exports line that throws an exception). so I added the typeof module != "undefined" which solved the problem in the case of my chrome extension.