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(common): Mark \r as a line ending #6752

Merged
merged 11 commits into from Jan 6, 2023
Merged

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jan 5, 2023

Description:

Related issue:

@kdy1 kdy1 added this to the Planned milestone Jan 5, 2023
@kdy1 kdy1 requested a review from jridgewell January 5, 2023 06:59
@kdy1 kdy1 marked this pull request as ready for review January 5, 2023 06:59
kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 5, 2023
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swc-bump:

  • swc_common

@@ -47,167 +48,6 @@ pub fn analyze_source_file(
(lines, multi_byte_chars, non_narrow_chars)
}

cfg_if::cfg_if! {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not ideal, but I'm not sure if this optimization is really required.

kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 5, 2023
@kdy1 kdy1 marked this pull request as draft January 5, 2023 07:48
@kdy1 kdy1 marked this pull request as ready for review January 6, 2023 01:57
@kdy1 kdy1 requested a review from jridgewell January 6, 2023 01:57
kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 6, 2023
@@ -240,6 +80,14 @@ fn analyze_source_file_generic(
let pos = BytePos::from_usize(i) + output_offset;

match byte {
b'\r' => {
lines.push(pos + BytePos(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this need to be + BytePos(2) if we're hitting a \r\n?

let source_map = sourcemap::SourceMap::from_slice(map.as_bytes())
.expect("failed to deserialize sourcemap");

dbg!(&source_map);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the debug and prints supposed to still be here?

kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 6, 2023
@kdy1 kdy1 requested a review from jridgewell January 6, 2023 02:20
jridgewell
jridgewell previously approved these changes Jan 6, 2023
@kdy1 kdy1 enabled auto-merge (squash) January 6, 2023 02:33
@kdy1 kdy1 dismissed stale reviews from jridgewell and kodiakhq via 5bb8255 January 6, 2023 02:38
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit 26a0c13 into swc-project:main Jan 6, 2023
@kdy1 kdy1 deleted the issue-6694 branch January 6, 2023 03:47
@kdy1 kdy1 modified the milestones: Planned, v1.3.26 Jan 11, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Windows line endings break source maps
3 participants