Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

feat(core): fix #996, expose UncaughtPromiseError #1040

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(core): fix #996, expose UncaughtPromiseError
  • Loading branch information
JiaLiPassion committed Mar 4, 2018
commit 65431fccd80815b6ddd74983f58361b9685493ea
7 changes: 0 additions & 7 deletions lib/common/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
return obj ? obj.toString() : Object.prototype.toString.call(obj);
}

interface UncaughtPromiseError extends Error {
zone: AmbientZone;
task: Task;
promise: ZoneAwarePromise<any>;
rejection: any;
}

const __symbol__ = api.symbol;
const _uncaughtPromiseErrors: UncaughtPromiseError[] = [];
const symbolPromise = __symbol__('Promise');
Expand Down
7 changes: 7 additions & 0 deletions lib/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ interface _ZoneFrame {
zone: Zone;
}

interface UncaughtPromiseError extends Error {
zone: Zone;
task: Task;
promise: Promise<any>;
rejection: any;
}

/**
* Provides a way to configure the interception of zone events.
*
Expand Down