Skip to content

Conversation

@kwonoj
Copy link
Member

@kwonoj kwonoj commented Nov 3, 2025

Description:

Attempt to fix #11214.

The reason for unespaced \\ was special handling for unicode \u codepoint, that escapes any string literal starts with \u - for windows, path separator with u (\\u) matches with this case.

PR attempts to solve by lookahead, confirming all 4 following char is hex digit to represent unicode hex, otherwise consider it as plain string. To be honest I'm not sure if this is acceptable approach or not, feel free to close if there's better way to fix.

BREAKING CHANGE:

Related issue (if exists):

#11214

@kwonoj kwonoj requested review from a team as code owners November 3, 2025 03:28
@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: 1344aef

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31931400 bytes)

Commit: e1d6c21

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 3, 2025

CodSpeed Performance Report

Merging #11216 will not alter performance

Comparing kwonoj:fix-11214-unicode (1344aef) with main (e5feaf1)

Summary

✅ 138 untouched

@kdy1
Copy link
Member

kdy1 commented Nov 3, 2025

cc @h-a-n-a Can you take a look? Does this look correct?

@kdy1
Copy link
Member

kdy1 commented Nov 3, 2025

Also, FYI, AI created #11217

@h-a-n-a
Copy link
Contributor

h-a-n-a commented Nov 3, 2025

cc @h-a-n-a Can you take a look? Does this look correct?

Looks like this is a correct implementation. I made a mistake in the previous PR

@kdy1 kdy1 added this to the Planned milestone Nov 3, 2025
Copy link
Member

@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.

Thank you!

@kdy1 kdy1 changed the title fix(atom): skip only unicode \u fix(hstr): Skip only \u for unicode Nov 3, 2025
@kdy1 kdy1 merged commit eda01e5 into swc-project:main Nov 3, 2025
184 checks passed
kdy1 pushed a commit that referenced this pull request Nov 5, 2025
**Description:**

Attempt to fix #11214.

The reason for unespaced `\\` was special handling for unicode `\u`
codepoint, that escapes any string literal starts with `\u` - for
windows, path separator with u (`\\u`) matches with this case.

PR attempts to solve by lookahead, confirming all 4 following char is
hex digit to represent unicode hex, otherwise consider it as plain
string. To be honest I'm not sure if this is acceptable approach or not,
feel free to close if there's better way to fix.

**Related issue:**

 - Closes #11214
@kdy1 kdy1 modified the milestones: Planned, 1.15.0 Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

SWC parser returns unevenly escaped windows path in ast

3 participants