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

committed by
Victor Berchet

parent
8a0e45826a
commit
b21a1d1961
18
packages/core/src/core.externs.js
Normal file
18
packages/core/src/core.externs.js
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @suppress {duplicate}
|
||||
*/
|
||||
var ng;
|
||||
/**
|
||||
* @suppress {duplicate}
|
||||
*/
|
||||
var wtf;
|
@ -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
|
||||
|
Reference in New Issue
Block a user