From 7f178b1526ec17dfc99cb71730b207d05f0ee802 Mon Sep 17 00:00:00 2001 From: JiaLiPassion Date: Wed, 14 Mar 2018 12:17:46 +0900 Subject: [PATCH] feat(core): fix #996, expose UncaughtPromiseError (#1040) --- lib/common/promise.ts | 7 ------- lib/zone.ts | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/common/promise.ts b/lib/common/promise.ts index bb34f5a20..90a68633c 100644 --- a/lib/common/promise.ts +++ b/lib/common/promise.ts @@ -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; - rejection: any; - } - const __symbol__ = api.symbol; const _uncaughtPromiseErrors: UncaughtPromiseError[] = []; const symbolPromise = __symbol__('Promise'); diff --git a/lib/zone.ts b/lib/zone.ts index 76efc031a..9cbd04fdc 100644 --- a/lib/zone.ts +++ b/lib/zone.ts @@ -336,6 +336,13 @@ interface _ZoneFrame { zone: Zone; } +interface UncaughtPromiseError extends Error { + zone: Zone; + task: Task; + promise: Promise; + rejection: any; +} + /** * Provides a way to configure the interception of zone events. *