Commit Graph

2 Commits

Author SHA1 Message Date
Paige Sun 20c9654ca7 2/n Code clarity: Use enum to clarify the values parsed by JsErrorHandler
Summary:
Changelog: [Internal] Code clarity: Use enum to clarify the values parsed by JsErrorHandler

Create a enum `JSErrorHandlerKey` to define the keys for the values that goes into each stack frame.

Next up -- using this in the Bridge!

Reviewed By: sammy-SC

Differential Revision: D40326127

fbshipit-source-id: e416814fbcaa922afa92d9baf79eaa898ff979f0
2022-10-14 10:48:47 -07:00
Paige Sun 84225573c1 1/n Add new JsErrorHandler buck target to parse JS errors in C++
Summary:
Changelog: [Internal][Added] 1/n Add new JsErrorHandler buck target to parse JS errors in C++

This JsErrorHandler.cpp class uses the same regex logic as [stack-trace-parser.js](https://github.com/errwischt/stacktrace-parser/blob/master/src/stack-trace-parser.js#L121) in order to parse JS errors into an array of stack frames.

In RN, stacktrace-parser is called from [Devtools/parseErrorStack.js](https://github.com/facebook/react-native/blob/8bd3edec88148d0ab1f225d2119435681fbbba33/Libraries/Core/Devtools/parseErrorStack.js#L46).

Reviewed By: sammy-SC

Differential Revision: D40296024

fbshipit-source-id: 8e1b034e8a1ee1a8cc808bfc36c7104a8f40f9cc
2022-10-13 21:40:08 -07:00