diff --git a/lib/util.js b/lib/util.js index f493c66d..76f5eebf 100644 --- a/lib/util.js +++ b/lib/util.js @@ -6,15 +6,12 @@ (function(scope) { 'use strict'; - var Scope; + var Scope = scope.window ? window : global; - if (scope.window) { - Scope = window; - Scope.Util = new UtilProto(); - } else { - Scope = global; - module.exports = new UtilProto(); - } + if (typeof module === 'object' && module.exports) + module.exports = new UtilProto(); + else + Scope.Util = new UtilProto(); function UtilProto() { var Util = this;