Skip to content

fix: use rest parameter in $ utility function to restore intended behavior#5897

Open
AdityaM-IITH wants to merge 1 commit intosugarlabs:masterfrom
AdityaM-IITH:fix-dollar-utility-rest-parameter
Open

fix: use rest parameter in $ utility function to restore intended behavior#5897
AdityaM-IITH wants to merge 1 commit intosugarlabs:masterfrom
AdityaM-IITH:fix-dollar-utility-rest-parameter

Conversation

@AdityaM-IITH
Copy link
Contributor

The $ utility function in block.js was broken during a refactor
from a standard function to an arrow function.

Arrow functions lack the arguments object, so the loop iterated over
an empty array and always returned [], silently ignoring all inputs.

Changes:

  • Replace empty array iteration with rest parameter (...args)
  • Function now correctly processes passed arguments as intended

Note: No current call sites found in the codebase. This PR fixes the
broken implementation for correctness — the function can be removed
entirely if deemed unnecessary.

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

palette.test.js
logo.test.js
logoconstants.test.js

@AdityaM-IITH AdityaM-IITH force-pushed the fix-dollar-utility-rest-parameter branch from b21d4d6 to 2477890 Compare February 24, 2026 18:03
@AdityaM-IITH
Copy link
Contributor Author

Rebased on latest master (83c5c8d). All 117 test suites passing locally.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

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