chore: replace var with const/let across codebase#5717
Merged
walterbender merged 2 commits intosugarlabs:masterfrom Feb 20, 2026
Merged
chore: replace var with const/let across codebase#5717walterbender merged 2 commits intosugarlabs:masterfrom
walterbender merged 2 commits intosugarlabs:masterfrom
Conversation
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
9eec786 to
491cd8b
Compare
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
Convert remaining var declarations to const/let for block scoping and clarity. 17 instances across 10 files. No behavioral changes.
491cd8b to
689d46d
Compare
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
Contributor
|
@vyagh @walterbender I’ve reviewed the changes. All var → const/let conversions look correct, and I don’t see any hoisting or scoping issues introduced. |
vanshika2720
approved these changes
Feb 16, 2026
Contributor
Author
|
yupp, did a proper browser testing before the push. |
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
hassan09070
pushed a commit
to hassan09070/musicblocks
that referenced
this pull request
Mar 15, 2026
Convert remaining var declarations to const/let for block scoping and clarity. 17 instances across 10 files. No behavioral changes. Co-authored-by: Walter Bender <walter@sugarlabs.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Converts the remaining
vardeclarations to const or let across the codebase. Most of these are in files that have already been partially modernized, these are just the stragglers that were missed in earlier passes.Each conversion was checked individually:
var that = thisremoved entirely (inlegobricks.js, all the callbacks in that scope already use arrow functions)Testing Performed
Checklist
Additional Notes for Reviewers
All conversions are mechanical , no logic changes.
The
DictActions.jscase is worth noting: the twovar msgdeclarations were in separateif/elsebranches so they didn't conflict, but const is still correct since each branch has its own block scope.The
legobricks.jsremoval is safe,thatwas never used anywhere in that scope. All the callbacks already use arrow functions, sothisis "lexically bound".