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

fix long-stack-trace zone will not render correctly when reject a pro…#403

Merged
mhevery merged 1 commit intoangular:masterfrom
JiaLiPassion:master
Aug 19, 2016
Merged

fix long-stack-trace zone will not render correctly when reject a pro…#403
mhevery merged 1 commit intoangular:masterfrom
JiaLiPassion:master

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Collaborator

I found a problem when using long-stack-trace zone, if I reject a promise inside the zone, the long stack trace will not rendered instead the original stack will be returned.
Because when promise was reject, zone will keep it in an array called _uncaughtPromiseErrors, and 
when drainMicroTaskQueue was called, the _uncaughtPromiseErrors will be rethrow with the original zone, but the Zone.currentTask has been cleared, so onHandleError of long-stack-trace will not rendered the correct long stack trace.
because the _uncaughtPromiseError has a reference of current task, we can check the task in long-stack-trace.

@mhevery mhevery merged commit 2d4ff65 into angular:master Aug 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants