|
6 | 6 | * found in the LICENSE file at https://angular.io/license
|
7 | 7 | */
|
8 | 8 |
|
| 9 | +/* |
| 10 | + * Suppress closure compiler errors about unknown 'global' variable |
| 11 | + * @fileoverview |
| 12 | + * @suppress {undefinedVars} |
| 13 | + */ |
| 14 | + |
9 | 15 | /**
|
10 | 16 | * Zone is a mechanism for intercepting and keeping track of asynchronous work.
|
11 | 17 | *
|
@@ -540,7 +546,7 @@ type AmbientZone = Zone;
|
540 | 546 | type AmbientZoneDelegate = ZoneDelegate;
|
541 | 547 |
|
542 | 548 | const Zone: ZoneType = (function(global: any) {
|
543 |
| - if (global.Zone) { |
| 549 | + if (global['Zone']) { |
544 | 550 | throw new Error('Zone already loaded.');
|
545 | 551 | }
|
546 | 552 |
|
@@ -1214,8 +1220,8 @@ const Zone: ZoneType = (function(global: any) {
|
1214 | 1220 | ZoneAwarePromise['race'] = ZoneAwarePromise.race;
|
1215 | 1221 | ZoneAwarePromise['all'] = ZoneAwarePromise.all;
|
1216 | 1222 |
|
1217 |
| - const NativePromise = global[__symbol__('Promise')] = global.Promise; |
1218 |
| - global.Promise = ZoneAwarePromise; |
| 1223 | + const NativePromise = global[__symbol__('Promise')] = global['Promise']; |
| 1224 | + global['Promise'] = ZoneAwarePromise; |
1219 | 1225 | function patchThen(NativePromise) {
|
1220 | 1226 | const NativePromiseProtototype = NativePromise.prototype;
|
1221 | 1227 | const NativePromiseThen = NativePromiseProtototype[__symbol__('then')] =
|
@@ -1428,5 +1434,5 @@ const Zone: ZoneType = (function(global: any) {
|
1428 | 1434 | // Cause the error to extract the stack frames.
|
1429 | 1435 | detectZone.runTask(detectZone.scheduleMacroTask('detect', detectRunFn, null, () => null, null));
|
1430 | 1436 |
|
1431 |
| - return global.Zone = Zone; |
| 1437 | + return global['Zone'] = Zone; |
1432 | 1438 | })(typeof window === 'object' && window || typeof self === 'object' && self || global);
|
0 commit comments