fix: create proper externs so that closure does not clobber e.g. ng for internal variables (#19423)

This commit is contained in:
Tobias Bosch
2017-09-26 15:02:33 -07:00
committed by Victor Berchet
parent 8a0e45826a
commit b21a1d1961
4 changed files with 57 additions and 4 deletions

View File

@ -21,6 +21,11 @@ const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'unde
self instanceof WorkerGlobalScope && self;
const __global = typeof global !== 'undefined' && global;
const _global: {[name: string]: any} = __window || __global || __self;
/**
* Attention: whenever providing a new value, be sure to add an
* entry into the corresponding `....externs.js` file,
* so that closure won't use that global for its purposes.
*/
export {_global as global};
// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim