Skip to content

Incorrect file path parsing with anonymous async function #15

Open
@byanofsky

Description

Seems when error stack trace includes an async, anonymous callee, the parsed stack trace file information is incorrect.

Repro:

Assume following error stack trace:

stack Error: test
    at f (https://some-domain.com/sample-program.js:18:15)
    at async https://some-domain.com/sample-program.js:22:11

Results in a second item with following properties:

file: "async https://some-domain.com/sample-program.js"
fileRelative: "some-domain.com/sample-program.js"
fileShort: "some-domain.com/sample-program.js"

Expected properties:

file: "https://some-domain.com/sample-program.js"
fileRelative: "sample-program.js"
fileShort: "sample-program.js"

Misc

Can reproduce the above error stack trace by running the following node program:

(async () => {
    await Promise.resolve();
    throw new Error('test');
})();

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions