mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(zone.js): move Error type into declare global block in zone.ts (#53443)
This helps consolidate globals into a single declaration in a single file. PR Close #53443
This commit is contained in:
parent
d8db402833
commit
52d672dd13
2 changed files with 15 additions and 17 deletions
|
|
@ -10,23 +10,6 @@
|
|||
* @suppress {globalThis,undefinedVars}
|
||||
*/
|
||||
|
||||
declare global {
|
||||
/**
|
||||
* Extend the Error with additional fields for rewritten stack frames
|
||||
*/
|
||||
interface Error {
|
||||
/**
|
||||
* Stack trace where extra frames have been removed and zone names added.
|
||||
*/
|
||||
zoneAwareStack?: string;
|
||||
|
||||
/**
|
||||
* Original stack trace with no modifications
|
||||
*/
|
||||
originalStack?: string;
|
||||
}
|
||||
}
|
||||
|
||||
Zone.__load_patch('Error', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
|
||||
/*
|
||||
* This code patches Error so that:
|
||||
|
|
|
|||
|
|
@ -26,6 +26,21 @@ declare global {
|
|||
type MicroTask = _MicroTask;
|
||||
type MacroTask = _MacroTask;
|
||||
type EventTask = _EventTask;
|
||||
|
||||
/**
|
||||
* Extend the Error with additional fields for rewritten stack frames
|
||||
*/
|
||||
interface Error {
|
||||
/**
|
||||
* Stack trace where extra frames have been removed and zone names added.
|
||||
*/
|
||||
zoneAwareStack?: string;
|
||||
|
||||
/**
|
||||
* Original stack trace with no modifications
|
||||
*/
|
||||
originalStack?: string;
|
||||
}
|
||||
}
|
||||
|
||||
// if global['Zone'] already exists (maybe zone.js was already loaded or
|
||||
|
|
|
|||
Loading…
Reference in a new issue