Skip to content

Fix implicit global variable in table-search.js - #6

Open
arijitroy003 wants to merge 1 commit into
RedHatOfficial:mainfrom
arijitroy003:fix/bug-3
Open

Fix implicit global variable in table-search.js#6
arijitroy003 wants to merge 1 commit into
RedHatOfficial:mainfrom
arijitroy003:fix/bug-3

Conversation

@arijitroy003

Copy link
Copy Markdown

Summary

Fix missing variable declaration for filter in searchTable() and filterTable(), which caused it to leak into the global scope.

Changes

  • Add const declaration to filter variable in searchTable() (line 11)
  • Add const declaration to filter variable in filterTable() (line 48)

Verification

  • Confirmed both assignments lacked let/const via grep
  • Verified no other references to a global filter exist in the codebase
  • const is appropriate here since filter is not reassigned within either function

Add const declaration to filter variable in searchTable() and
filterTable() functions. Without let/const, the variable leaks
into the global scope, which can cause unexpected behavior when
both functions reference the same implicit global.
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