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 {