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
@ -54,7 +54,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
|
||||
|
||||
const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');
|
||||
|
||||
function handleUnhandledRejection(e: any) {
|
||||
function handleUnhandledRejection(this: unknown, e: any) {
|
||||
api.onUnhandledError(e);
|
||||
try {
|
||||
const handler = (Zone as any)[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];
|
||||
@ -198,7 +198,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
|
||||
}
|
||||
|
||||
const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');
|
||||
function clearRejectedNoCatch(promise: ZoneAwarePromise<any>): void {
|
||||
function clearRejectedNoCatch(this: unknown, promise: ZoneAwarePromise<any>): void {
|
||||
if ((promise as any)[symbolState] === REJECTED_NO_CATCH) {
|
||||
// if the promise is rejected no catch status
|
||||
// and queue.length > 0, means there is a error handler
|
||||
@ -453,7 +453,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
|
||||
api.patchThen = patchThen;
|
||||
|
||||
function zoneify(fn: Function) {
|
||||
return function() {
|
||||
return function(this: unknown) {
|
||||
let resultPromise = fn.apply(this, arguments);
|
||||
if (resultPromise instanceof ZoneAwarePromise) {
|
||||
return resultPromise;
|
||||
|
Reference in New Issue
Block a user