Skip to content

Conversation

@BentSm
Copy link

@BentSm BentSm commented Feb 3, 2022

These fix miscellaneous code issues:

  • Variables leaked to global scope
  • An insufficiently deep copy
  • An inconsistent tokenIndex value

(See the commits for more precise details.)

Ben Small added 3 commits January 27, 2022 18:36
Certain loop variables were unscoped, and thereby becoming global; also, a per-level variable (bannedGroup) was not scoped in certain places to the corresponding level object, thus becoming global as well.
(The rules property is an array of arrays, but was getting copied as if it was an array of ordinary data.)
The tokenIndex was being set to 1 for level messages, so the comment handler remained active.  This could cause strange behavior if the message began with a '('.
Copy link
Owner

@increpare increpare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot of these - some nice spring-cleaning. (I'll change the level.bannedgroup thing to just be a local var though)

@increpare increpare merged commit 3ddd299 into increpare:master Feb 21, 2022
increpare added a commit that referenced this pull request Feb 21, 2022
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