Skip to content

Commit 83e9713

Browse files
authored
chore: remove debug console statements from js/EnsembleBlocks.js
2 parents 971a9c6 + b8ec8cf commit 83e9713

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

js/blocks/EnsembleBlocks.js

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,19 @@ function getTargetTurtle(turtles, targetTurtle) {
3838
}
3939
}
4040

41-
// eslint-disable-next-line no-console
42-
console.debug(`turtle "${targetTurtle}" not found`);
41+
//Debug: `turtle "${targetTurtle}" not found` returning null
4342
return null;
4443
}
4544

4645
function _blockFindTurtle(activity, turtle, blk, receivedArg) {
4746
const cblk = activity.blocks.blockList[blk].connections[1];
4847
if (cblk === null) {
49-
// eslint-disable-next-line no-console
50-
console.debug("Could not find connecting block");
48+
//Debug: connecting block not found, returning null
5149
return null;
5250
}
5351
const targetTurtle = activity.logo.parseArg(activity.logo, turtle, cblk, blk, receivedArg);
5452
if (targetTurtle === null) {
55-
// eslint-disable-next-line no-console
56-
console.debug("Could not find target turtle name from arg");
53+
//Debug: target turtleName from arg not found, returning null
5754
return null;
5855
}
5956
return activity.turtles.getTurtle(getTargetTurtle(activity.turtles, targetTurtle));
@@ -213,8 +210,7 @@ function setupEnsembleBlocks(activity) {
213210
tur.parentFlowQueue = [];
214211
tur.unhighlightQueue = [];
215212
tur.parameterQueue = [];
216-
// eslint-disable-next-line no-console
217-
console.debug("stopping " + targetTurtle);
213+
218214
activity.turtles.ithTurtle(turtle).running = false;
219215
logo.doBreak(tur);
220216
}
@@ -255,8 +251,6 @@ function setupEnsembleBlocks(activity) {
255251
}
256252

257253
flow(args, logo, turtle, blk, receivedArg, actionArgs, isflow) {
258-
// eslint-disable-next-line no-console
259-
console.debug("start mouse from mouse " + turtle);
260254
if (args[0] === null) {
261255
activity.errorMsg(NOINPUTERRORMSG, blk);
262256
return;
@@ -296,8 +290,6 @@ function setupEnsembleBlocks(activity) {
296290
}
297291
}
298292
if (foundStartBlock) {
299-
// eslint-disable-next-line no-console
300-
console.debug("STARTING " + targetTurtle + " " + startBlk);
301293
logo.runFromBlock(logo, targetTurtle, startBlk, isflow, receivedArg);
302294
} else {
303295
activity.errorMsg(_("Cannot find start block") + " " + args[0], blk);
@@ -538,8 +530,7 @@ function setupEnsembleBlocks(activity) {
538530

539531
if (thisTurtle) return activity.turtles.screenY2turtleY(thisTurtle.container.y);
540532
thisTurtle = activity.turtles.getTurtle(turtle);
541-
// eslint-disable-next-line no-console
542-
console.debug("Mouse not found. Using current mouse value instead.");
533+
// Debug: Mouse not found. Using current mouse value instead (fallback behavior)
543534
return activity.turtles.screenY2turtleY(thisTurtle.container.y);
544535
}
545536
}
@@ -585,8 +576,7 @@ function setupEnsembleBlocks(activity) {
585576
if (thisTurtle) return activity.turtles.screenX2turtleX(thisTurtle.container.x);
586577

587578
thisTurtle = activity.turtles.getTurtle(turtle);
588-
// eslint-disable-next-line no-console
589-
console.debug("Mouse not found. Using current mouse value instead.");
579+
// Debug: Mouse not found. Using current mouse value instead (fallback behavior)
590580
return activity.turtles.screenX2turtleX(thisTurtle.container.x);
591581
}
592582
}
@@ -716,8 +706,7 @@ function setupEnsembleBlocks(activity) {
716706
logo.synth.inTemperament
717707
);
718708
} else {
719-
// eslint-disable-next-line no-console
720-
console.debug("Cannot find a note for mouse " + turtle);
709+
//Debug: note for mouse not found + turtle
721710
activity.errorMsg(INVALIDPITCH, blk);
722711
obj = ["G", 4];
723712
}
@@ -755,8 +744,7 @@ function setupEnsembleBlocks(activity) {
755744
logo.synth.inTemperament
756745
);
757746
} else {
758-
// eslint-disable-next-line no-console
759-
console.debug("Cannot find a note for mouse " + turtle);
747+
//Debug: note for mouse not found + turtle
760748
activity.errorMsg(INVALIDPITCH, blk);
761749
obj = ["G", 4];
762750
}
@@ -1030,8 +1018,7 @@ function setupEnsembleBlocks(activity) {
10301018

10311019
activity.blocks.loadNewBlocks(newBlock);
10321020
} else {
1033-
// eslint-disable-next-line no-console
1034-
console.debug("Turtle " + turtleName + " already exists.");
1021+
// Debug: Attempted to create turtle that already exists
10351022
activity.stage.dispatchEvent(turtleName);
10361023
}
10371024
}

0 commit comments

Comments
 (0)