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

Support source maps #1308

Open
gausie opened this issue Mar 6, 2023 · 4 comments
Open

Support source maps #1308

gausie opened this issue Mar 6, 2023 · 4 comments
Labels
feature Issues considered a new feature

Comments

@gausie
Copy link
Contributor

gausie commented Mar 6, 2023

Following up on this old comment, I wanted to log an issue for supporting column numbers and thus support source maps in rhino.

@p-bakker
Copy link
Collaborator

p-bakker commented Mar 7, 2023

Could you please clarify exactly what you're requesting?

The way your request is currently worded, it sounds like you're just requesting column number support, which, if added, would automatically cause Rhino to support sourcemaps.

If so, where do you expect column numbers to appear/be supported in Rhino?

If after adding column number support in the relevant places more is needed to (fully) support sourcemaps in Rhino, please elaborate or better yet open a separate case for that.

Any chance you're willing and able to take a stab at it and provide a PR?

@p-bakker p-bakker added the feature Issues considered a new feature label Oct 16, 2023
@p-bakker
Copy link
Collaborator

Assuming the idea is to 'just' translate line & column numbers on stacktraces, I could see an API that allows you to register a 'SourceMapper' and when registered, Rhino calls that to convert line and column numbers

The actual 'SourceMapper' implementation is then pluggable and could be for example (a wrapper around) https://github.com/atlassian/sourcemap

For completeness, this seems the specifications of sourcemaps: https://docs.google.com/document/u/0/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/mobilebasic?pli=1

@p-bakker
Copy link
Collaborator

Just FYI: Looks like there will be an effort to officially standardize sourcemaps: https://ecma-international.org/news/ecma-tc39-ecmascript-initiates-a-new-task-group-to-standardize-source-maps/

@gausie
Copy link
Contributor Author

gausie commented Sep 22, 2024

I think getting line and column numbers attached to errors is unrelated to any new standards - that would only be if we wanted to respect the standard when reporting the error. Which, I suppose would also be nice.

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

No branches or pull requests

2 participants