Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.

Document that AxeCuprite::Results takes ownership of (deep-freezes) the passed hash - #36

Merged
AbuMareBear merged 1 commit into
mainfrom
docs/results-ownership-freeze-33
Jun 16, 2026
Merged

AbuMareBear merged 1 commit into
mainfrom
docs/results-ownership-freeze-33

Conversation

@AbuMareBear

Copy link
Copy Markdown
Contributor

Summary

Documentation-only change for #33. No behavior change.

Results.new (and the nested Violation / Node / ContrastData wrappers) call DeepFreeze.call on the hash they're given, freezing it in place. That's safe for the internal flow (payload comes fresh off the CDP boundary), but Results is public API — Runner#run returns one, and a caller can build Results.new(some_hash) themselves — so a reused hash can surface a surprising FrozenError. This makes the ownership transfer explicit.

Changes

  • lib/axe/cuprite/results.rb — added an ownership note to the Results class doc comment.
  • README.md — mirrored the note in the runner section.
  • CHANGELOG.md — entry under [Unreleased] → Changed.

Closes #33

…he passed hash

Results (and the nested Violation/Node/ContrastData wrappers) deep-freeze the
hash they are given in place. That is safe for the internal CDP-boundary flow,
but Results is public API, so a caller building Results.new(hash) could be
surprised by a FrozenError on a hash they reuse afterward.

Make the ownership transfer explicit in the Results doc comment and the README
runner section, and note it in the changelog. Documentation only; no behavior
change.

Closes #33
@AbuMareBear
AbuMareBear merged commit 49cd636 into main Jun 16, 2026
6 checks passed
@AbuMareBear
AbuMareBear deleted the docs/results-ownership-freeze-33 branch June 16, 2026 18:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document that AxeCuprite::Results takes ownership of (deep-freezes) the hash passed to it

1 participant