_root.js 521 B

123456789101112131415
  1. var checkGlobal = require('./_checkGlobal');
  2. /** Detect free variable `global` from Node.js. */
  3. var freeGlobal = checkGlobal(typeof global == 'object' && global);
  4. /** Detect free variable `self`. */
  5. var freeSelf = checkGlobal(typeof self == 'object' && self);
  6. /** Detect `this` as the global object. */
  7. var thisGlobal = checkGlobal(typeof this == 'object' && this);
  8. /** Used as a reference to the global object. */
  9. var root = freeGlobal || freeSelf || thisGlobal || Function('return this')();
  10. module.exports = root;