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

fix(lookup_token): should be None if original tokens hasn't the line #9

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

underfin
Copy link
Contributor

@underfin underfin commented Dec 11, 2024

close rolldown/rolldown#3112.

You could see the pervious test (1000, 0) return (2, 8), it is last token at original mapping, if we add more token exceeding the line, it will always mapping to the last token, it is incorrect.

The pr fixed it. Here create Vec<LineLookupTable> for original tokens, if is easy to check exceeding line, and also has better performance than the previous implement, it only binarySearch the line tokens instead of the all tokens. It inspire from https://github.com/jridgewell/trace-mapping/blob/main/src/trace-mapping.ts#L178

@Boshen
Copy link
Member

Boshen commented Dec 11, 2024

@hi-ogawa can you help me review?

src/sourcemap.rs Outdated Show resolved Hide resolved
@Boshen Boshen merged commit e8cec38 into oxc-project:main Dec 11, 2024
4 checks passed
@Boshen Boshen mentioned this pull request Dec 11, 2024
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

Successfully merging this pull request may close these issues.

[Bug]:The remapping source is incorrect
3 participants