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

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

Merged
merged 2 commits into from
Apr 10, 2017
Merged

Conversation

JiaLiPassion
Copy link
Collaborator

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

Copy link
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?)

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
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
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.

lib/zone.ts Outdated
const fakeTransitionTo =
(toState: TaskState, fromState1: TaskState, fromState2: TaskState) => {};
childDetectZone.scheduleEventTask(
'detect',
Copy link
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
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