Would a non-async call be possible?
winterstein opened this issue · 4 comments
Expected Behavior
Would it be possible for an API that does a synchronous return (without using promises)? E.g.
StackTrace.getNow() -> array of stackframes
I understand that the results would be more limited, but probably still an improvement on the raw output from new Error().stack.
Context
This would let me use it in code where the thread/async flow has to remain as-is.
stacktrace.js v1.3.0 added StackTrace.getSync() that returns an Array of StackFrames just as you want. This does not do any source maps or function name guessing.
Please reopen this issue if this functionality is insufficient for you.
@winterstein Just wanted to mention that it is also possible to synchronously get the source-mapped stack-trace. It's not part of the API, but it's possible with some modifications. See here: #188