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

Commit

Permalink
feat: return setTimeout Id in ZoneTask.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
hmdhk committed Jul 12, 2016
1 parent ed69756 commit fe4c372
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ interface TaskData {
* Delay in milliseconds when the Task will run.
*/
delay?: number;

/**
* identifier returned by the native setTimeout.
*/
handleId?: number;
}

/**
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit fe4c372

Please sign in to comment.