Commit 0624d3d
authored
fix: address 4 critical bugs in core utilities and singer logic (sugarlabs#5679)
* fix: address 4 critical bugs in core utilities and singer logic
1. Fix numberOfNotes() crash (ReferenceError) — removed dead code
referencing undefined variables left over from an incomplete
refactor to saveState. (turtle-singer.js)
2. Fix rationalSum() silently mutating its input arrays — replaced
in-place array assignments with local const variables to prevent
corrupting the caller's note-timing state. (utils.js)
3. Fix safeSVG() only escaping the first special character — added
the global /g flag to all three regex patterns. (utils.js)
4. Fix doUseCamera() using deprecated navigator.getUserMedia API —
updated to modern navigator.mediaDevices.getUserMedia() with
proper promise-based flow and feature detection. (utils.js)
* refactor: adopt CameraManager from upstream PR sugarlabs#5662
Replaced bare hasSetupCamera variable with the CameraManager
module introduced in upstream PR sugarlabs#5662. All internal references
updated from hasSetupCamera to CameraManager.isSetup while
preserving the modern
avigator.mediaDevices.getUserMedia() fix.
Ran prettier on both changed files.1 parent 1e11bf2 commit 0624d3d
2 files changed
+19
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | 663 | | |
676 | 664 | | |
677 | 665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | 1096 | | |
1105 | 1097 | | |
1106 | 1098 | | |
| |||
1111 | 1103 | | |
1112 | 1104 | | |
1113 | 1105 | | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1122 | 1110 | | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1123 | 1115 | | |
1124 | 1116 | | |
1125 | | - | |
1126 | | - | |
| 1117 | + | |
| 1118 | + | |
1127 | 1119 | | |
1128 | 1120 | | |
1129 | 1121 | | |
1130 | | - | |
1131 | | - | |
| 1122 | + | |
1132 | 1123 | | |
1133 | 1124 | | |
1134 | 1125 | | |
| |||
1219 | 1210 | | |
1220 | 1211 | | |
1221 | 1212 | | |
1222 | | - | |
| 1213 | + | |
1223 | 1214 | | |
1224 | 1215 | | |
1225 | 1216 | | |
| |||
1414 | 1405 | | |
1415 | 1406 | | |
1416 | 1407 | | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1422 | 1413 | | |
1423 | 1414 | | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
| 1415 | + | |
| 1416 | + | |
1427 | 1417 | | |
1428 | 1418 | | |
1429 | 1419 | | |
| |||
0 commit comments