Skip to content

Inaccurate filename extracted from Error generated from Zone.js Proxy #44

Description

@YoungCatChen

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:

var locationParts = this.extractLocation(tokens.pop());

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions