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

feat(error): an idea for simple stack#693

Merged
mhevery merged 2 commits intoangular:masterfrom
JiaLiPassion:newerror
Apr 10, 2017
Merged

feat(error): an idea for simple stack#693
mhevery merged 2 commits intoangular:masterfrom
JiaLiPassion:newerror

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Collaborator

An idea to only throw one error to detect most zone stack trace frames.

Copy link
Copy Markdown
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I will have to do some perf testing before I merge it in. (Can you take care of the minor comments?)

Comment thread lib/zone.ts Outdated
// Cause the error to extract the stack frames.
detectZone.runTask(detectZone.scheduleMacroTask('detect', detectRunFn, null, () => null, null));
});
Error.stackTraceLimit = 15;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should store and restore, rather than reset to 15

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do.

Comment thread lib/zone.ts Outdated
const fakeTransitionTo =
(toState: TaskState, fromState1: TaskState, fromState2: TaskState) => {};
childDetectZone.scheduleEventTask(
'detect',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to keep the size down, can we reuse existing string such as blacklistedStackFramesSymbol?

Copy link
Copy Markdown
Collaborator Author

@JiaLiPassion JiaLiPassion Mar 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will modify this one.

@JiaLiPassion JiaLiPassion force-pushed the newerror branch 2 times, most recently from 65e8f5d to aec8cff Compare March 23, 2017 05:22
@mhevery mhevery merged commit 8142c3b into angular:master Apr 10, 2017
mhevery added a commit that referenced this pull request Apr 10, 2017
mhevery pushed a commit that referenced this pull request Apr 10, 2017
* feat(error): an idea for simple stack

* merge detectZone
@JiaLiPassion JiaLiPassion deleted the newerror branch May 6, 2017 04:56
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