Skip to content

Fix a bug where shared strands variables are detected in the wrong spot#8641

Merged
davepagurek merged 2 commits intodev-2.0from
fix/shared-variable
Mar 14, 2026
Merged

Fix a bug where shared strands variables are detected in the wrong spot#8641
davepagurek merged 2 commits intodev-2.0from
fix/shared-variable

Conversation

@davepagurek
Copy link
Contributor

Resolves #8640

Changes:

  • Removes some old code tracking global assignments which was causing a bug

Basically, there was some special-casing before to make sure that varying variables correctly assigned to globals. This was causing a problem, because the global assignments were getting generated in the first hook, which is not actually the correct one in all cases. Anyway, turns out that after other updates, it seems we don't even need any of that, and we can just delete code and have my new test case pass + all of the old ones!

Live: (fixed) https://editor.p5js.org/davepagurek/sketches/mZUJxE4BY
Original (buggy, thanks @nbogie for finding it!) https://editor.p5js.org/neill0/sketches/lKYbBowtV

PR Checklist

@davepagurek davepagurek merged commit 618e4c8 into dev-2.0 Mar 14, 2026
5 checks passed
@davepagurek davepagurek deleted the fix/shared-variable branch March 14, 2026 13:39
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.

1 participant