From fe4c37266d35c52f77780232c0dbbe03cb59290c Mon Sep 17 00:00:00 2001 From: Hamidreza Jahtalab Date: Tue, 12 Jul 2016 13:08:08 +0200 Subject: [PATCH] feat: return setTimeout Id in ZoneTask.toString --- lib/zone.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/zone.ts b/lib/zone.ts index c7cbe663b..1ed122f92 100644 --- a/lib/zone.ts +++ b/lib/zone.ts @@ -395,6 +395,11 @@ interface TaskData { * Delay in milliseconds when the Task will run. */ delay?: number; + + /** + * identifier returned by the native setTimeout. + */ + handleId?: number; } /** @@ -819,6 +824,14 @@ const Zone: ZoneType = (function(global: any) { } }; } + + public toString() { + if (this.data && typeof this.data.handleId !== 'undefined') { + return this.data.handleId + } else { + return this.toString() + } + } } interface UncaughtPromiseError extends Error {