error-stack-parser
error-stack-parser copied to clipboard
Inaccurate filename extracted from Error generated from Zone.js Proxy
Consider this error stack:
Error
at StackTrace$$GenerateError (http://concatjs/base/third_party/javascript/cucumber_js/cucumber.js:54957:19) [ProxyZone]
at Object.StackTrace$$getSync [as getSync] (http://concatjs/base/third_party/javascript/cucumber_js/cucumber.js:55019:23) [ProxyZone]
The error-stack-parser library finds the wrong location.
Expected Behavior
The location should be http://.../cucumber.js:54957:19.
Current Behavior
The location it finds is [ProxyZone].
Steps to Reproduce (for bugs)
<Working on a repro; but let me know if you don't need one.>
Context
I'm trying to use CucumberJS for my Angular2+ app's testing framework. CucumberJS uses this library to find relevant information of where a step is defined. Angular2+ app may be run under Zone.js, which may use its Proxy to do some stuff.
Your Environment
- stacktrace.js version: v2.0.2
- Browser Name and version: Chrome 69.0.3497.100
- Operating System and version: macOS High Sierra 10.13.6
- Link to your project: sorry there's no link to an internal project; I can work on a repro if needed.
Possible Solution
I'm not an export, but I guess this thing tokens.pop() may be the culprit:
https://github.com/stacktracejs/error-stack-parser/blob/2d84c602aeb2182544e4e5cc65add13d990473de/error-stack-parser.js#L62