Sha256: 1077c2fa8bd912fa810f8750b1dc0156cc2e47adcb5267b8b081c967aadee7b0

Contents?: true

Size: 691 Bytes

Versions: 3

Compression:

Stored size: 691 Bytes

Contents

// from lodash to catch fake globals
function checkGlobal(value) {
    return value && value.Object === Object ? value : undefined;
}
// element ids can ruin global miss checks
function checkElementIdShadowing(value) {
    return value && value.nodeType === undefined ? value : undefined;
}
// export real global
export default checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) ||
    checkGlobal(typeof self === 'object' && self) ||
    checkGlobal(typeof window === 'object' && window) ||
    (typeof mainContext !== 'undefined' && mainContext) || // set before strict mode in Ember loader/wrapper
    new Function('return this')(); // eval outside of strict mode

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/environment/lib/global.js
discourse-ember-source-3.5.1.1 dist/es/ember-environment/lib/global.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-environment/lib/global.js