Skip to content

Conversation

@pfgithub
Copy link
Contributor

@pfgithub pfgithub commented Oct 9, 2025

Fixes #23382

Breaking change because any existing snapshots that have unicode keys will need to be regenerated

@robobun
Copy link
Collaborator

robobun commented Oct 9, 2025

Updated 9:55 PM PT - Oct 8th, 2025

@pfgithub, your commit 9d5d270 has 1 failures in Build #28625 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 23390

That installs a local version of the PR into your bun-23390 executable, so you can run:

bun-23390 --bun

@pfgithub pfgithub changed the title Fix 23382 (unicode object key printed as 'key Fix 23382 (unicode object key printed as 'key" in snapshot instead of "key") Oct 9, 2025
@pfgithub pfgithub marked this pull request as ready for review October 9, 2025 04:23
@pfgithub pfgithub merged commit 46cf50d into main Oct 9, 2025
57 of 60 checks passed
@pfgithub pfgithub deleted the pfg/23382 branch October 9, 2025 04:25
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates pretty_format.zig to simplify UTF-16 key printing by using a const slice and removing per-quote escaping. Adds a regression test validating inline snapshot formatting for objects with Unicode keys.

Changes

Cohort / File(s) Summary of Changes
Pretty format UTF-16 key handling
src/bun.js/test/pretty_format.zig
Simplified 16-bit key printing: bind utf16Slice as const, remove in-slice quote-escaping loop, write opening quote, then UTF-16 slice, followed by existing trailing formatting.
Regression test for Unicode keys
test/regression/issue/23382.test.js
Added test verifying inline snapshot formatting for an object with a Unicode key to ensure correct serialization of non-ASCII keys.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d17134f and 9d5d270.

📒 Files selected for processing (2)
  • src/bun.js/test/pretty_format.zig (1 hunks)
  • test/regression/issue/23382.test.js (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Snapshot objects with Unicode keys are garbled

3 participants