Skip to content

fix(runtime): preserve byte-view toString with short encodings - #12456

Merged
proggeramlug merged 5 commits into
PerryTS:mainfrom
jdalton:cloud/issue-11519-byte-family-tostring
Oct 12, 2026
Merged

proggeramlug merged 5 commits into
PerryTS:mainfrom
jdalton:cloud/issue-11519-byte-family-tostring

Conversation

@jdalton

@jdalton jdalton commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Refs #11519. This partial repair covers the ArrayBuffer-family toString residual left open by #11627. When ArrayBuffer, SharedArrayBuffer, or DataView reaches the shared Buffer dispatcher, its inherited Object.prototype.toString behavior must ignore every argument. The dispatcher now sends these non-indexed byte views through the canonical object-tag path before Buffer encoding and range handling. Buffer's own encoding behavior remains unchanged.

The regressions cover no argument, runtime-built short and literal encodings, extra range arguments, throwing coercion, and Buffer controls. A direct dispatcher test checks byte-view brands with short and heap encoding values and keeps the Buffer hex path as a control.

At final fragment head 6f2f622f228f93ce6d56026b5041c7b456ca2195, a fresh locked build of all three packages passed, the numbered-fragment self-test and live PR gate passed, and the freshly compiled 18-case no-auto fixture again matched pinned Node 26.5.1. The sole change from 5e41d1d is changelog.d/12456-byte-view-tostring.md; source, tests and build inputs are identical. Focused unit, genuine auto-optimization and full-lint evidence below are reused from 5e41d1d, with their original provenance; they were not rerun at the fragment head. Linux validation cannot prove macOS behavior.

At 5e41d1d8b19c030754975afeca52a9c277eda739, the coherent dev build of perry, perry-runtime-static, and perry-stdlib-static passed. The focused direct runtime test passed (1 passed, 5,797 filtered out). The 18-case fixture compiled with --no-auto-optimize and with the default auto-optimization path; both outputs matched pinned Node 26.5.1. The auto-optimization run rebuilt the matching runtime and stdlib archives with the async-bridge feature, without fallback; an initial 180-second build timeout is retained in the evidence, and the longer retry passed.

Validation was performed on Linux. Full scripts/run_lint_gates.sh completed with exit 1: 30 of 137 commands failed and two CI-only commands were skipped. Twenty-eight failures reproduce the saved baseline (25 static/release checks and three warning/Clippy commands). The Windows xwin gate is blocked by proxy HTTP 403. The docs wrapper misses the external target directory; direct generation matches the earlier baseline-attributed outputs, including markdown drift against the tracked empty reference. Full lint is not claimed green. Custom Symbol.toStringTag overrides on registered byte-view receivers and typed-string Symbol.iterator identity remain outside this partial fix.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b2aff9d3-f27e-480f-b84e-bb244a1a9764

📥 Commits

Reviewing files that changed from the base of the PR and between ccbd617 and 6f2f622.


📒 Files selected for processing (4)
  • changelog.d/12456-byte-view-tostring.md
  • crates/perry-runtime/src/object/buffer_dispatch.rs
  • crates/perry-runtime/src/value/to_string_buffer_tests.rs
  • test-files/test_gap_11519_arraybuffer_to_string_short_encoding.ts

 ___________________________________________________________________________
< What can I say except 'You're welcome' for the bugs I found in your code? >
 ---------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jdalton
jdalton marked this pull request as ready for review October 12, 2026 08:47
@proggeramlug
proggeramlug merged commit 8d75cc4 into PerryTS:main Oct 12, 2026
107 of 129 checks passed
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.

2 participants