Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filename, line, column to Error #956

Open
Sytten opened this issue Mar 7, 2025 · 1 comment
Open

Add filename, line, column to Error #956

Sytten opened this issue Mar 7, 2025 · 1 comment

Comments

@Sytten
Copy link

Sytten commented Mar 7, 2025

Hi! Transitioning from quickjs, I was to having the filename (JS_ATOM_fileName), line (JS_ATOM_lineNumber) and column (JS_ATOM_columnNumber) on the Error object. I think they were added in the build_backtrace method (https://github.com/bellard/quickjs/blob/6e2e68fd0896957f92eb6c242a2e048c1ef3cae0/quickjs.c#L6559).

It was useful when you want to offer to the user some indication of where the error comes from without displaying the whole stack trace.

@saghul
Copy link
Contributor

saghul commented Mar 8, 2025

I can't seem to find it now, but IIRC we removed those because they are nonstandard.

You can use Error.prepareStackTrace to add them to the error object if you need to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants