-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Align earlyjs c++ stack trace parsing with js #46894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
33a5b18 to
bc4f84a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
bc4f84a to
6296810
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
6296810 to
9a89124
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
9a89124 to
af2f5d3
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
af2f5d3 to
ee29f59
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
ee29f59 to
8d7df1c
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
8d7df1c to
040211a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
040211a to
ffdd2d1
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
ffdd2d1 to
13da136
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
13da136 to
2c0125e
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
2c0125e to
2653774
Compare
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
2653774 to
8d15569
Compare
da194e3 to
0579cd3
Compare
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
0579cd3 to
4673d8f
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
4673d8f to
514ba23
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
514ba23 to
25d7534
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
25d7534 to
15beaa6
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
15beaa6 to
8597ea5
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
8597ea5 to
ff868ce
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
Summary: For the js error handling pipeline, the javascript data structure looks like [this](https://www.internalfb.com/code/fbsource/[6181b57f4ba3619f58056bcec65382650d6ff59a]/xplat/js/react-native-github/packages/react-native/src/private/specs/modules/NativeExceptionsManager.js?lines=17-35): ``` export type StackFrame = {| column: ?number, file: ?string, lineNumber: ?number, methodName: string, collapse?: boolean, |}; export type ExceptionData = { message: string, originalMessage: ?string, name: ?string, componentStack: ?string, stack: Array<StackFrame>, id: number, isFatal: boolean, // flowlint-next-line unclear-type:off extraData?: Object, ... }; ``` So, I made the c++ data structure look similar ``` struct ParsedError { struct StackFrame { std::optional<std::string> file; std::string methodName; std::optional<int> lineNumber; std::optional<int> column; }; std::string message; std::optional<std::string> originalMessage; std::optional<std::string> name; std::optional<std::string> componentStack; std::vector<StackFrame> stack; int id; bool isFatal; jsi::Object extraData; }; ``` Notes: * [parseErrorStack](https://fburl.com/code/e27q9gkc) doesn't actually generate a collapse property on the error object. So, I omitted it from the c++. * ExceptionsManager [always provides an extraData field](https://fburl.com/code/2bvcsxac). So, I made it required. * In C++, I just stored extraData as a jsi::Object. I wanted the freedom to store arbitrary key/value pairs. But, I also didn't want to use folly::dynamic. Changelog: [Internal] Reviewed By: alanleedev Differential Revision: D63929580
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
ff868ce to
7ee42cd
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63659013 |
|
This pull request has been merged in 934af0c. |
Summary:
This diff re-implements js error stack trace parsing in c++.
Details:
I also migrated all their tests to c++:
Changelog: [Internal]
Reviewed By: javache, NickGerleman
Differential Revision: D63659013