Skip to content

fix: Avoid callers accidentally mutating comment internal state - #10577

Merged
gonfunko merged 1 commit into
mainfrom
i-think-im-a-clone-now
Oct 15, 2026
Merged

gonfunko merged 1 commit into
mainfrom
i-think-im-a-clone-now

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Proposed Changes

This PR makes CommentView.getRelativeToSurfaceXY() return a clone of its location, rather than its actual internal location coordinate. This bit me in Scratch where the dragging system inadvertently mutated this value. I also verified that other implementations of that method either return clones or newly constructed coordinate objects.

Reason for Changes

Callers shouldn't be able to accidentally mutate internal state.

@gonfunko
gonfunko requested a review from a team as a code owner October 15, 2026 15:27
@gonfunko
gonfunko requested a review from lizschwab October 15, 2026 15:27
@github-actions github-actions Bot added the PR: fix Fixes a bug label Oct 15, 2026
@gonfunko
gonfunko merged commit d3d93a8 into main Oct 15, 2026
11 checks passed
@gonfunko
gonfunko deleted the i-think-im-a-clone-now branch October 15, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants