in strict mode, this is undefined

This commit is contained in:
John Tantalo 2012-11-27 19:50:35 -08:00
parent 1f4befe4c3
commit ea9d093f0d

View File

@ -358,7 +358,7 @@
};
// check whether script is running inside node.js export as module
if (typeof exports !== 'undefined' && this.toString() !== '[object DOMWindow]') {
if (typeof exports !== 'undefined' && (!this || this.toString() !== '[object DOMWindow]')) {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = UAParser;
}