The PhraseMaker widget (js/widgets/phrasemaker.js) uses loops in _updateTupletValue that iterate with for (let i = 0; i <= this.activity.logo.tupletRhythms.length; i++), which can iterate one past the end of the tupletRhythms array and cause out-of-bounds access and runtime errors.
Suggested fix: replace <= with < for the affected loops so iteration goes from 0..length-1.
Files to change:
- js/widgets/phrasemaker.js
How to validate:
- Open the PhraseMaker widget and exercise tuplet editing (increase/decrease tuplet values) to ensure no console errors.
- Run
npx prettier --check js/widgets/phrasemaker.js and relevant lint/tests.
The PhraseMaker widget (js/widgets/phrasemaker.js) uses loops in _updateTupletValue that iterate with
for (let i = 0; i <= this.activity.logo.tupletRhythms.length; i++), which can iterate one past the end of the tupletRhythms array and cause out-of-bounds access and runtime errors.Suggested fix: replace
<=with<for the affected loops so iteration goes from 0..length-1.Files to change:
How to validate:
npx prettier --check js/widgets/phrasemaker.jsand relevant lint/tests.