refactor: ensure zone.js can be built with typescript strict flag (#30993)
As part of FW-1265, the `zone.js` package is made compatible with the TypeScript `--strict` flag. Read more about the strict flag [here](https://www.typescriptlang.org/docs/handbook/compiler-options.html) PR Close #30993
This commit is contained in:

committed by
Miško Hevery

parent
10a1e1974b
commit
60f58bf051
@ -52,7 +52,7 @@ Zone.__load_patch('fakeasync', (global: any, Zone: ZoneType, api: _ZonePrivate)
|
||||
*/
|
||||
function fakeAsync(fn: Function): (...args: any[]) => any {
|
||||
// Not using an arrow function to preserve context passed from call site
|
||||
return function(...args: any[]) {
|
||||
return function(this: unknown, ...args: any[]) {
|
||||
const proxyZoneSpec = ProxyZoneSpec.assertPresent();
|
||||
if (Zone.current.get('FakeAsyncTestZoneSpec')) {
|
||||
throw new Error('fakeAsync() calls can not be nested');
|
||||
@ -150,4 +150,4 @@ Zone.__load_patch('fakeasync', (global: any, Zone: ZoneType, api: _ZonePrivate)
|
||||
function flushMicrotasks(): void { _getFakeAsyncZoneSpec().flushMicrotasks(); }
|
||||
(Zone as any)[api.symbol('fakeAsyncTest')] = {
|
||||
resetFakeAsyncZone, flushMicrotasks, discardPeriodicTasks, tick, flush, fakeAsync};
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user