Fix a bug where shared strands variables are detected in the wrong spot by davepagurek · Pull Request #8641 · processing/p5.js

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